Giuseppe Scrivano wrote: > this patch fixes a race condition when a watched file is modified > between `tail_file' and `inotify_add_watch'. > I refactored out a new function from `tail_forever_inotify' and force a > check, using this same new function, after inotify watchers are already > active. ... > Subject: [PATCH] tail: fix a race condition > > * NEWS (Bug fixes): Mention it. > * src/tail.c (check_fspec): New function. > (tail_forever_inotify): Ensure there is no new data before entering the > inotify events wait loop.
Hi Giuseppe, Thank you! I haven't reviewed this yet, but will do so today or tomorrow. I know triggering race conditions can be hard, but can you write a script that demonstrates the failure? This might be a good excuse to experiment with the now-usable-as-non-root system tap (stap) tool. It's fine for test scripts to rely on bleeding-edge technology -- just skip the test if the tool is not available; most developers will have it. BTW, did you notice an actual failure, or did you spot this via inspection?
