diff options
author | Jim Meyering <meyering@redhat.com> | 2012-05-04 16:42:31 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2012-05-07 13:39:48 +0200 |
commit | ee9e43460f366406edff96b5abfb3ff33587e062 (patch) | |
tree | 7451920817eb2c42bcc4aee062074f46e2f9d041 /NEWS | |
parent | 3468d26884800d7bc6fcc1ba52cd481175c655d8 (diff) | |
download | coreutils-ee9e43460f366406edff96b5abfb3ff33587e062.tar.xz |
cp: handle a race condition more sensibly
* src/copy.c (copy_reg): In a narrow race (stat sees dest, yet
open-without-O_CREAT fails with ENOENT), retry the open with O_CREAT.
* tests/cp/nfs-removal-race: New file.
* tests/Makefile.am (TESTS): Add it.
* NEWS (Bug fixes): Mention it.
Reported by Philipp Thomas and Neil F. Brown in
http://bugs.gnu.org/11100
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -11,6 +11,14 @@ GNU coreutils NEWS -*- outline -*- changed, the new group ID would be listed, even though it is not yet effective. [bug introduced in coreutils-8.1] + cp S D is no longer subject to a race: if an existing D were removed + between the initial stat and subsequent open-without-O_CREATE, cp would + fail with a confusing diagnostic saying that the destination, D, was not + found. Now, in this unusual case, it retries the open (but with O_CREATE), + and hence usually succeeds. With NFS attribute caching, the condition + was particularly easy to trigger, since there, the removal of D could + precede the initial stat. [This bug was present in "the beginning".] + ** New features fmt now accepts the --goal=WIDTH (-g) option. |