From 0cc3ec3d1add90d860786382dc5abe7ca94d242e Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Fri, 8 Feb 2008 04:18:16 -0800 Subject: [PATCH] inotify: fix check for one-shot watches before destroying them patch ac74c00e499ed276a965e5b5600667d5dc04a84a in mainline. As the IN_ONESHOT bit is never set when an event is sent we must check it in the watch's mask and not in the event's mask. Signed-off-by: Ulisses Furquim Reported-by: "Clem Taylor" Tested-by: "Clem Taylor" Cc: Amy Griffis Cc: Robert Love Cc: John McCutchan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/inotify_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/inotify_user.c b/fs/inotify_user.c index 5e009331c01ff..7253ffd47d393 100644 --- a/fs/inotify_user.c +++ b/fs/inotify_user.c @@ -269,7 +269,7 @@ static void inotify_dev_queue_event(struct inotify_watch *w, u32 wd, u32 mask, /* we can safely put the watch as we don't reference it while * generating the event */ - if (mask & IN_IGNORED || mask & IN_ONESHOT) + if (mask & IN_IGNORED || w->mask & IN_ONESHOT) put_inotify_watch(w); /* final put */ /* coalescing: drop this event if it is a dupe of the previous */ -- 2.47.2