mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Inotify fails to send IN_ATTRIB events
@ 2007-11-21  3:11 Morten Welinder
  2007-11-22 15:34 ` Jan Kara
  2007-11-23 19:54 ` Morten Welinder
  0 siblings, 2 replies; 9+ messages in thread
From: Morten Welinder @ 2007-11-21  3:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: rlove, Linus Torvalds

I am seeing missing inotify IN_ATTRIB events in the following situation:

1. "touch foo"

2. Make inotify watch "foo"

3. "ln foo bar"
   --> Link count changed so I should have gotten an IN_ATTRIB.

4. "rm foo"
   --> Link count changed so I should have gotten an IN_ATTRIB.  (Or
IN_DELETE_SELF;
   I don't care which.)

5. "ln bar foo && rm bar"
   --> Still no events.

6. "mv foo bar"
   --> I get IN_MOVED_SELF.  Good!

7. "mv bar foo"
   --> I get IN_MOVED_SELF.  Good!


3+4 is pretty much the same as 6, so I really ought to be told that my
file has changed
name.  I don't really care much about getting notified about 3, but
for completeness
it ought to be handled.

As far as I can see, the only way to be told about 4 is to put a watch
on the directory in
which foo resides.  That is inelegant and has an inherent race condition.

This is with "Linux version 2.6.22.12-0.1-default" (SuSE 10.3)

Looking at current source, fs/namei.c, I notice that vfs_rename has a
fsnotify_move call
(which notified directory as well as files) whereas sys_link only has
a fsnotify_create call
(which notified the directory only).

Morten

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-28 12:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-21  3:11 Inotify fails to send IN_ATTRIB events Morten Welinder
2007-11-22 15:34 ` Jan Kara
2007-11-23  1:49   ` Morten Welinder
2007-11-23 14:18     ` Morten Welinder
2007-11-23 19:54 ` Morten Welinder
2007-11-26 16:00   ` Jan Kara
     [not found]     ` <118833cc0711260806x69fc2bb6n572f1e1253a201ef@mail.gmail.com>
2007-11-26 16:27       ` [PATCH] Send IN_ATTRIB events when link count changes Jan Kara
2007-11-27 20:46         ` Andrew Morton
2007-11-28 12:53           ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®