mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
cp: fix the buffer size used when writing zeros
* src/copy.c (write_zeros): This bug caused 4 or 8 bytes to be written at a time which is very inefficient. One could trigger the issue with `cp --sparse=never sparse non-sparse` on a file system that supports fiemap.
This commit is contained in:
1 parent
f8f57dd76b
commit
84e5274f7e
1 file changed
+1
-1
+1
-1
@@ -291,7 +291,7 @@ write_zeros (int fd, uint64_t n_bytes)
|
||||
|
||||
while (n_bytes)
|
||||
{
|
||||
uint64_t n = MIN (sizeof nz, n_bytes);
|
||||
uint64_t n = MIN (nz, n_bytes);
|
||||
if ((full_write (fd, zeros, n)) != n)
|
||||
return false;
|
||||
n_bytes -= n;
|
||||
|
||||
Reference in new issue
Block a user