Jim Meyering <j...@meyering.net> writes: > Goswin von Brederlow wrote: >> Package: coreutils >> Version: 8.5-1 >> Severity: normal >> File: /bin/cp >> >> when copying files the size of the resulting file is known (except in >> race conditions) beforehand and should be communicated to the >> filesystem using posix_fallocate(). This ensures there is enough space >> for the file and more importantly allows the filesystem to place the >> file better, idealy as on continious chunk, on the filesystem. >> >> Some care must be taken to ftruncate() the file to its smaller size if >> the source file has shrunk while copying. >> >> If the file has grown while copying one could posix_fallocate() to the >> new size repeadately till the full file is copied but it probably >> wouldn't hurt to ignore that case and just copy the remainder of the >> grown file without allocating space first. > > In upstream discussion, Pádraig Brady just wrote about precisely that: > > http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/23023/focus=23409
Good to know this isn't completly ignored. As a side note: This also applies to dd and might be much simpler to handle there since dd never uses sparse files. Dd should use fallocate() at least whenever it has a "count=xxx". MfG Goswin -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org