All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUGFIX] dnotify: handle_event shouldn't match on FS_EVENT_ON_CHILD
@ 2009-10-18 12:46 Andreas Gruenbacher
  2009-10-18 12:49 ` Andreas Gruenbacher
  2009-10-18 15:52 ` Eric Paris
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Gruenbacher @ 2009-10-18 12:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Andrew Morton, Eric Paris

Mask off FS_EVENT_ON_CHILD in dnotify_handle_event().  Otherwise, when there
is more than one watch on a directory and dnotify_should_send_event()
succeeds, events with FS_EVENT_ON_CHILD set will trigger all watches and cause
spurious events.

This case was overlooked in commit e42e2773.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
---
 fs/notify/dnotify/dnotify.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c
index 828a889..0a8f1de 100644
--- a/fs/notify/dnotify/dnotify.c
+++ b/fs/notify/dnotify/dnotify.c
@@ -106,7 +106,7 @@ static int dnotify_handle_event(struct fsnotify_group *group,
 	spin_lock(&entry->lock);
 	prev = &dnentry->dn;
 	while ((dn = *prev) != NULL) {
-		if ((dn->dn_mask & event->mask) == 0) {
+		if ((dn->dn_mask & event->mask & ~FS_EVENT_ON_CHILD) == 0) {
 			prev = &dn->dn_next;
 			continue;
 		}
--

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

end of thread, other threads:[~2009-10-18 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-18 12:46 [BUGFIX] dnotify: handle_event shouldn't match on FS_EVENT_ON_CHILD Andreas Gruenbacher
2009-10-18 12:49 ` Andreas Gruenbacher
2009-10-18 15:52 ` Eric Paris
2009-10-18 19:22   ` Andreas Gruenbacher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.