diff options
author | Wayne Davison <wayned@samba.org> | 2013-06-02 12:37:48 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2013-06-02 12:37:48 -0700 |
commit | 0ab8e166f44940dad79e8b80ae0b960336efa10c (patch) | |
tree | ef65232ddfab623c862d99c69fca3568a5cf200e | |
parent | 1e9ee19a716b72454dfeab663802c626b81cdf2e (diff) | |
download | rsync-0ab8e166f44940dad79e8b80ae0b960336efa10c.tar.gz |
Avoid preallocation on inplace file that is already long enough.
-rw-r--r-- | receiver.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -241,7 +241,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r, OFF_T preallocated_len = 0; #endif - if (preallocate_files && fd != -1 && total_size > 0) { + if (preallocate_files && fd != -1 && total_size > 0 && (!inplace || total_size > size_r)) { /* Try to preallocate enough space for file's eventual length. Can * reduce fragmentation on filesystems like ext4, xfs, and NTFS. */ if (do_fallocate(fd, 0, total_size) == 0) { |