From 6fcf3bb6227a4949aeee2741dc73eb3c55a3bfef Mon Sep 17 00:00:00 2001 From: Ulisses Furquim Date: Thu, 7 Feb 2008 15:19:19 -0300 Subject: [PATCH] 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 --- fs/inotify_user.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/inotify_user.c b/fs/inotify_user.c index a336c97..3ab09a6 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 */ -- 1.5.4