Commit ac74c00e authored by Ulisses Furquim's avatar Ulisses Furquim Committed by Linus Torvalds

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: default avatarUlisses Furquim <ulissesf@gmail.com>
Reported-by: default avatar"Clem Taylor" <clem.taylor@gmail.com>
Tested-by: default avatar"Clem Taylor" <clem.taylor@gmail.com>
Cc: Amy Griffis <amy.griffis@hp.com>
Cc: Robert Love <rlove@google.com>
Cc: John McCutchan <ttb@tentacle.dhs.org>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a4ffc0a0
...@@ -283,7 +283,7 @@ static void inotify_dev_queue_event(struct inotify_watch *w, u32 wd, u32 mask, ...@@ -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 /* we can safely put the watch as we don't reference it while
* generating the event * generating the event
*/ */
if (mask & IN_IGNORED || mask & IN_ONESHOT) if (mask & IN_IGNORED || w->mask & IN_ONESHOT)
put_inotify_watch(w); /* final put */ put_inotify_watch(w); /* final put */
/* coalescing: drop this event if it is a dupe of the previous */ /* coalescing: drop this event if it is a dupe of the previous */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment