inotify: IN_IGNORED is not sent

From: ÐÐÑÐ ÐÐÑÐÐÐÐÑÐ
Date: Wed Oct 10 2012 - 05:58:20 EST


Suppose this code:

i = inotify_init1(IN_CLOEXEC);
wd = inotify_add_watch(i, "/tmp/target2", IN_ATTRIB);
for(;;) {
read (wd, ...);
inotify_rm_watch(i, wd); // FAIL HERE
wd = inotify_add_watch(i, "/tmp/target2", IN_ATTRIB);
}

Now, in shell:
$ :> /tmp/jjj
$ mv /tmp/jjj /tmp/target2

In that case IN_IGNORED is not sent, but wd previously added by
inotify_add_watch() become invalid, so, trying to call
inotify_rm_watch() failed with EINVAL.

--
Segmentation fault
--
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/