diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index a18b8d7a3075..ca3405f73264 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -114,6 +114,10 @@ static bool fanotify_should_send_event(struct fsnotify_iter_info *iter_info, if (!fsnotify_iter_should_report_type(iter_info, type)) continue; mark = iter_info->marks[type]; + + /* Apply ignore mask regardless of ISDIR and ON_CHILD flags */ + marks_ignored_mask |= mark->ignored_mask; + /* * If the event is for a child and this mark doesn't care about * events on a child, don't send it! @@ -124,7 +128,6 @@ static bool fanotify_should_send_event(struct fsnotify_iter_info *iter_info, continue; marks_mask |= mark->mask; - marks_ignored_mask |= mark->ignored_mask; } if (d_is_dir(path->dentry) &&