From: Ulisses Furquim Date: Fri, 8 Feb 2008 12:18:16 +0000 (-0800) Subject: inotify: fix check for one-shot watches before destroying them X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ac74c00e499ed276a965e5b5600667d5dc04a84a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git inotify: fix check for one-shot watches before destroying them 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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/inotify_user.c b/fs/inotify_user.c index a336c9709f3c..3ab09a65c456 100644 --- a/fs/inotify_user.c +++ b/fs/inotify_user.c @@ -283,7 +283,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 */