]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
inotify: fix check for one-shot watches before destroying them
authorUlisses Furquim <ulissesf@gmail.com>
Fri, 8 Feb 2008 12:18:16 +0000 (04:18 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 26 Feb 2008 00:18:32 +0000 (16:18 -0800)
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 <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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/inotify_user.c

index 5e009331c01ff5fbe1a453f735e906e54645368f..7253ffd47d3932359ae0ef9d39be4f5f61948b84 100644 (file)
@@ -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 */