summaryrefslogtreecommitdiffstats
path: root/fs/notify
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-09-01 02:40:01 -0400
committerJan Kara <jack@suse.cz>2018-09-03 08:57:41 -0400
commit9bdda4e9cf2dcecb60a0683b10ffb8cd7e5f2f45 (patch)
tree6a398221129f73a256d4257fa32a6702542f9b4a /fs/notify
parent60c1f89241d49bacf71035470684a8d7b4bb46ea (diff)
fsnotify: fix ignore mask logic in fsnotify()
Commit 92183a42898d ("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: 92183a42898d ("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>
Diffstat (limited to 'fs/notify')
-rw-r--r--fs/notify/fsnotify.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index f174397b63a0..ababdbfab537 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -351,16 +351,9 @@ int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is,
351 351
352 iter_info.srcu_idx = srcu_read_lock(&fsnotify_mark_srcu); 352 iter_info.srcu_idx = srcu_read_lock(&fsnotify_mark_srcu);
353 353
354 if ((mask & FS_MODIFY) || 354 iter_info.marks[FSNOTIFY_OBJ_TYPE_INODE] =
355 (test_mask & to_tell->i_fsnotify_mask)) { 355 fsnotify_first_mark(&to_tell->i_fsnotify_marks);
356 iter_info.marks[FSNOTIFY_OBJ_TYPE_INODE] = 356 if (mnt) {
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);
364 iter_info.marks[FSNOTIFY_OBJ_TYPE_VFSMOUNT] = 357 iter_info.marks[FSNOTIFY_OBJ_TYPE_VFSMOUNT] =
365 fsnotify_first_mark(&mnt->mnt_fsnotify_marks); 358 fsnotify_first_mark(&mnt->mnt_fsnotify_marks);
366 } 359 }