[BUGFIX] dnotify: handle_event shouldn't match on FS_EVENT_ON_CHILD

From: Andreas Gruenbacher
Date: Sun Oct 18 2009 - 08:49:38 EST


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@xxxxxxx>
---
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;
}
--
--
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/