Re: v2.6.31-rc6 inotify not reporting deleted files

From: Eric Paris
Date: Wed Aug 26 2009 - 07:25:31 EST


On Wed, 2009-08-26 at 02:06 -0700, Eric W. Biederman wrote:
> I don't have a small test case yet, but I have an application that
> uses inotify and watches a file and takes action when that file has been
> deleted. Running that application on 2.6.31-rc6 the application is
> no longer seeing the file being deleted.
>
> With luck a word to the wise is all that is required for you to reproduce
> this. Otherwise I will spend some time tomorrow making a small reproducer.

I'm probably going to need a little more to go on. The most simple
tests seem to work for me...

kernel-2.6.31-0.167.rc6.git6.fc12.x86_64

Watch /tmp/ while deleting /tmp/tmp:
$ touch /tmp/tmp
$ inotifywait -m /tmp
Setting up watches.
Watches established.
/tmp/ DELETE tmp
^C

Watch /tmp/tmp while deleting /tmp/tmp
$ touch /tmp/tmp
$ inotifywait -m /tmp/tmp
Setting up watches.
Watches established.
/tmp/tmp ATTRIB
/tmp/tmp DELETE_SELF
/tmp/tmp IGNORED

Delete 2 files while inotifywait is asleep
$touch /tmp/tmp1 /tmp/tmp2
$inotifywait -m /tmp
Setting up watches.
Watches established.
^Z
[1]+ Stopped inotifywait -m /tmp
$ rm -f /tmp/tmp1
$ rm -f /tmp/tmp2
$ fg
inotifywait -m /tmp
/tmp/ DELETE tmp1
/tmp/ DELETE tmp2
^C

Delete 2 directories while inotifywait is asleep
$ mkdir /tmp/tmp1 /tmp/tmp2
$ inotifywait -m /tmp
Setting up watches.
Watches established.
^Z
[1]+ Stopped inotifywait -m /tmp
$ rmdir /tmp/tmp1
$ rmdir /tmp/tmp2
$ fg
inotifywait -m /tmp
/tmp/ DELETE,ISDIR tmp1
/tmp/ DELETE,ISDIR tmp2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/