Commit ac74c00e499ed276a965e5b5600667d5dc04a84a
Committed by
Linus Torvalds
1 parent
a4ffc0a0b2
Exists in
master
and in
7 other branches
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 <ulissesf@gmail.com> Reported-by: "Clem Taylor" <clem.taylor@gmail.com> Tested-by: "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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
fs/inotify_user.c
... | ... | @@ -283,7 +283,7 @@ |
283 | 283 | /* we can safely put the watch as we don't reference it while |
284 | 284 | * generating the event |
285 | 285 | */ |
286 | - if (mask & IN_IGNORED || mask & IN_ONESHOT) | |
286 | + if (mask & IN_IGNORED || w->mask & IN_ONESHOT) | |
287 | 287 | put_inotify_watch(w); /* final put */ |
288 | 288 | |
289 | 289 | /* coalescing: drop this event if it is a dupe of the previous */ |