Bug 104660 - inotify: IN_IGNORED is sent although unlinked file is not watched anymore
Summary: inotify: IN_IGNORED is sent although unlinked file is not watched anymore
Status: RESOLVED INVALID
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Beta 1
Hardware: Other All
: P5 - None : Normal
Target Milestone: ---
Assignee: Robert Love
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-15 11:25 UTC by Gernot Payer
Modified: 2005-08-16 14:34 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gernot Payer 2005-08-15 11:25:45 UTC
When doing this

wd = inotify_add_watch(fd, "file", IN_ACCESS);
(do stuff with "file")
inotify_rm_watch(fd, wd);
close(file_fd);
unlink("file");

there is still an IN_IGNORED event pending in fd, although "file" is deleted 
after the watch has been removed. I don't think this is the intended behaviour.
Comment 1 Robert Love 2005-08-15 16:20:06 UTC
You will get an IN_IGNORED event when you remove the watch.

So, unless you are seeing TWO such events, this is not a bug.
Comment 2 Gernot Payer 2005-08-16 08:55:00 UTC
I'm sorry, but this behaviour makes absolutely no sense to me. When I remove a 
watch, then I don't want to get any further events about that file/dir.

You might also want to describe this behaviour in the documentation.
Comment 3 Robert Love 2005-08-16 14:34:43 UTC
It is consistent: You get an IN_IGNORED event whenever an event is removed,
regardless of how.

Also, it lets applications handle event removal in a single place, their
IN_IGNORED handler.