diff options
author | Pádraig Brady <P@draigBrady.com> | 2013-11-07 13:26:25 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2013-11-08 13:33:50 +0000 |
commit | c93d5b4aa7f675dabaebf5e4ee9583162e4c977d (patch) | |
tree | 4d2f9263b40382fb0c133cf5a46392595e3acae5 /NEWS | |
parent | bf6bf52dce37832b03ecfbe1b3a3b104f532df42 (diff) | |
download | coreutils-c93d5b4aa7f675dabaebf5e4ee9583162e4c977d.tar.xz |
shred: fix direct I/O failures for last write to file
Since direct I/O is now enabled with commit v8.21-139-gebaf961
we must handle the case where we write an odd size at the
end of a file (with --exact), or we specify an odd --size that
is larger than 64KiB, or in the very unlikely case of a device
with an odd size. This issue was present since direct I/O
support was first added in v5.3.0, but latent since v6.0.
Theoretically this could have also been an issue after that on
systems which didn't have alignment constraints, but did have
size constraints for direct I/O.
* src/shred.c (dopass): On the first pass for a file, always
retry a write that fails with EINVAL, so we handle direct I/O
failure at either the start or end of the file. Adjust the comment
as the original case is out of date and implicitly handled
by this more general fix.
* tests/misc/shred-exact.sh: Add a test case.
* NEWS: Add a "bug fix" entry for shred since there are
two related issues now fixed.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -37,6 +37,11 @@ GNU coreutils NEWS -*- outline -*- rm -I now prompts for confirmation before removing a write protected file. [Bug introduced in coreutils-6.8] + shred once again uses direct I/O on systems requiring aligned buffers. + Also direct I/O failures for odd sized writes at end of file are now handled. + [The "last write" bug was introduced in coreutils-5.3.0 but masked + by the alignment bug introduced in coreutils-6.0] + tail --retry -f now waits for the files specified to appear. Before, tail would immediately exit when such a file is inaccessible during the initial open. @@ -92,9 +97,8 @@ GNU coreutils NEWS -*- outline -*- Reservoir sampling is used to limit memory usage based on the number of outputs, rather than the number of inputs. - shred once again uses direct I/O where available, and increases write block - size from 12KiB to 64KiB when possible. - [Direct I/O regression introduced in coreutils-6.0] + shred increases write block size from 12KiB to 64KiB when possible, + to align with other utilities and reduce the system call overhead. split --line-bytes=SIZE, now only allocates memory as needed rather than allocating SIZE bytes at program start. |