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
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]