Bug 16296

Summary: inotify keeps watching unlinked files
Product: Other Reporter: Matthias Clasen (mclasen)
Component: OtherAssignee: Eric Paris (eparis)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, david-sarah, eparis
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Matthias Clasen 2010-06-25 21:34:30 UTC
krb5-auth-dialog watches /tmp/krbcc_500 or whatever that file is called,
using gio, which puts a inotify watch on the directory

vte creates files backing its scrollback in /tmp and unlinks them right away

but there's a ton of activity on those files while I do some git --filter-branch things

and I see krb5-auth-dialog eat 10% cpu, handling inotify events for those unlinked vte files

should those unlinked files continue to create inotify traffic ?
I mean, unlinking explicitly unties them from the watched directory, no ?
Comment 1 Eric Paris 2010-07-13 20:23:29 UTC
http://lkml.org/lkml/2010/7/13/360
Comment 2 Eric Paris 2010-07-13 20:24:09 UTC
I'm going to force programs to use a new flag to ignore unlinked files.  I have no idea if some obscure program would break if I did it by default.....
Comment 3 David-Sarah Hopwood 2011-07-30 00:00:06 UTC
Shouldn't this be closed as fixed, since the http://www.kernel.org/doc/man-pages/online/pages/man7/inotify.7.html has "IN_EXCL_UNLINK (since Linux 2.6.36)"?