Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'fsnotify_for_v4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fsnotify fix from Jan Kara:
"One small fsnotify fix for duplicate events"

* tag 'fsnotify_for_v4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
fanotify: fix handling of events on child sub-directory

+10 -7
+5 -5
fs/notify/fanotify/fanotify.c
··· 115 115 continue; 116 116 mark = iter_info->marks[type]; 117 117 /* 118 - * if the event is for a child and this inode doesn't care about 119 - * events on the child, don't send it! 118 + * If the event is for a child and this mark doesn't care about 119 + * events on a child, don't send it! 120 120 */ 121 - if (type == FSNOTIFY_OBJ_TYPE_INODE && 122 - (event_mask & FS_EVENT_ON_CHILD) && 123 - !(mark->mask & FS_EVENT_ON_CHILD)) 121 + if (event_mask & FS_EVENT_ON_CHILD && 122 + (type != FSNOTIFY_OBJ_TYPE_INODE || 123 + !(mark->mask & FS_EVENT_ON_CHILD))) 124 124 continue; 125 125 126 126 marks_mask |= mark->mask;
+5 -2
fs/notify/fsnotify.c
··· 167 167 parent = dget_parent(dentry); 168 168 p_inode = parent->d_inode; 169 169 170 - if (unlikely(!fsnotify_inode_watches_children(p_inode))) 170 + if (unlikely(!fsnotify_inode_watches_children(p_inode))) { 171 171 __fsnotify_update_child_dentry_flags(p_inode); 172 - else if (p_inode->i_fsnotify_mask & mask) { 172 + } else if (p_inode->i_fsnotify_mask & mask & ALL_FSNOTIFY_EVENTS) { 173 173 struct name_snapshot name; 174 174 175 175 /* we are notifying a parent so come up with the new mask which ··· 339 339 sb = mnt->mnt.mnt_sb; 340 340 mnt_or_sb_mask = mnt->mnt_fsnotify_mask | sb->s_fsnotify_mask; 341 341 } 342 + /* An event "on child" is not intended for a mount/sb mark */ 343 + if (mask & FS_EVENT_ON_CHILD) 344 + mnt_or_sb_mask = 0; 342 345 343 346 /* 344 347 * Optimization: srcu_read_lock() has a memory barrier which can