diff options
author | Amir Goldstein <amir73il@gmail.com> | 2022-02-23 17:14:37 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2022-02-24 14:04:51 +0100 |
commit | 4f0b903ded728c505850daf2914bfc08841f0ae6 (patch) | |
tree | 2d9d04addb7cdc156b2f7c151cfeb22f7f5d11a0 /fs/notify/mark.c | |
parent | dfd42facf1e4ada021b939b4e19c935dcdd55566 (diff) |
fsnotify: fix merge with parent's ignored mask
fsnotify_parent() does not consider the parent's mark at all unless
the parent inode shows interest in events on children and in the
specific event.
So unless parent added an event to both its mark mask and ignored mask,
the event will not be ignored.
Fix this by declaring the interest of an object in an event when the
event is in either a mark mask or ignored mask.
Link: https://lore.kernel.org/r/20220223151438.790268-2-amir73il@gmail.com
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r-- | fs/notify/mark.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c index 9007d6affff3..4853184f7dde 100644 --- a/fs/notify/mark.c +++ b/fs/notify/mark.c @@ -127,7 +127,7 @@ static void __fsnotify_recalc_mask(struct fsnotify_mark_connector *conn) return; hlist_for_each_entry(mark, &conn->list, obj_list) { if (mark->flags & FSNOTIFY_MARK_FLAG_ATTACHED) - new_mask |= mark->mask; + new_mask |= fsnotify_calc_mask(mark); } *fsnotify_conn_mask_p(conn) = new_mask; } @@ -692,7 +692,7 @@ int fsnotify_add_mark_locked(struct fsnotify_mark *mark, if (ret) goto err; - if (mark->mask) + if (mark->mask || mark->ignored_mask) fsnotify_recalc_mask(mark->connector); return ret; |