Skip to content

Commit 9bdda4e

Browse files
amir73iljankara
authored andcommitted
fsnotify: fix ignore mask logic in fsnotify()
Commit 92183a4 ("fsnotify: fix ignore mask logic in send_to_group()") acknoledges the use case of ignoring an event on an inode mark, because of an ignore mask on a mount mark of the same group (i.e. I want to get all events on this file, except for the events that came from that mount). This change depends on correctly merging the inode marks and mount marks group lists, so that the mount mark ignore mask would be tested in send_to_group(). Alas, the merging of the lists did not take into account the case where event in question is not in the mask of any of the mount marks. To fix this, completely remove the tests for inode and mount event masks from the lists merging code. Fixes: 92183a4 ("fsnotify: fix ignore mask logic in send_to_group") Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 60c1f89 commit 9bdda4e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

fs/notify/fsnotify.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,9 @@ int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is,
351351

352352
iter_info.srcu_idx = srcu_read_lock(&fsnotify_mark_srcu);
353353

354-
if ((mask & FS_MODIFY) ||
355-
(test_mask & to_tell->i_fsnotify_mask)) {
356-
iter_info.marks[FSNOTIFY_OBJ_TYPE_INODE] =
357-
fsnotify_first_mark(&to_tell->i_fsnotify_marks);
358-
}
359-
360-
if (mnt && ((mask & FS_MODIFY) ||
361-
(test_mask & mnt->mnt_fsnotify_mask))) {
362-
iter_info.marks[FSNOTIFY_OBJ_TYPE_INODE] =
363-
fsnotify_first_mark(&to_tell->i_fsnotify_marks);
354+
iter_info.marks[FSNOTIFY_OBJ_TYPE_INODE] =
355+
fsnotify_first_mark(&to_tell->i_fsnotify_marks);
356+
if (mnt) {
364357
iter_info.marks[FSNOTIFY_OBJ_TYPE_VFSMOUNT] =
365358
fsnotify_first_mark(&mnt->mnt_fsnotify_marks);
366359
}

0 commit comments

Comments
 (0)