summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-05-05 22:11:24 +0100
committerPádraig Brady <P@draigBrady.com>2015-05-11 23:03:32 +0100
commitcf06a872e74b45588c2e64903f7fc99cf2aafe27 (patch)
tree56ab22a4de51b29f1f49f2e02f506be416b06244 /NEWS
parent9069f4ec850364e778c51bfa6f1ab761be67caec (diff)
downloadcoreutils-cf06a872e74b45588c2e64903f7fc99cf2aafe27.tar.xz
tail: fix inotify startup races
The previous fixes to races in the various tail tests, identified actual races in the tail inotify implementation. With --follow=descriptor, if the tailed file was replaced before the inotify watch was added, then any subsequent changes were ignored. Similarly in --follow=name mode, all changes to a new name were effectively ignored if that name was created after the original open() but before the inotify_add_watch(). * src/tail.c (tail_forever_inotify): Fix 3 cases. 1. With -f, don't stop tailing when file removed before watch. 2. With -f, watch right file when file replaced before watch. 3. With -F, inspect correct file when replaced before watch. Existing tests identify these when tail compiled with TAIL_TEST_SLEEP. * tests/tail-2/inotify-rotate-resources.sh: This test also identifies the issue with --follow=name when TAIL_TEST_SLEEP is used. Adjust so the test is immune to such races, and also fail quicker on remote file systems. * tests/tail-2/inotify-race2.sh: A new test using GDB, based on inotify-race.sh, which tests the -F race without needed recompilation with sleeps. * tests/local.mk: Reference the new test. * NEWS: Mention the bug.
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS4
1 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index fc652f11a..da2b53d2e 100644
--- a/NEWS
+++ b/NEWS
@@ -45,6 +45,10 @@ GNU coreutils NEWS -*- outline -*-
tail -f again follows changes to a file after it's renamed.
[bug introduced in coreutils-7.5]
+ tail --follow no longer misses changes to files if those files were
+ replaced before inotify watches were created.
+ [bug introduced in coreutils-7.5]
+
** New features
chroot accepts the new --skip-chdir option to not change the working directory