lkml.org 
[lkml]   [2010]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] fanotify: dont destroy mark when ignore mask is cleared
From
Date
On Mon, 2010-11-22 at 18:52 +0100, Lino Sanfilippo wrote:
> In mark_remove_from_mask() the mark is destroyed regardless of whether the
> event mask or ignore mask is cleared. We should only destroy the mark if the
> event mask is cleared.
>
> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>

Hmmmm, really I'm not sure if that is right either (but it's certainly
closer) What about something like:

diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 81df3ad..29fbf17 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -527,7 +527,7 @@ static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark,
}
spin_unlock(&fsn_mark->lock);

- if (!(oldmask & ~mask))
+ if (!fsn_mark->mask && !fsn_mark->ignored_mask)
fsnotify_destroy_mark(fsn_mark);

return mask & oldmask;



\
 
 \ /
  Last update: 2010-11-23 20:53    [W:0.115 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site