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_v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fanotify fix from Jan Kara:
"A single fanotify fix from Amir"

* tag 'fsnotify_for_v5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
fanotify: fix logic of reporting name info with watched parent

+7 -5
+7 -5
fs/notify/fsnotify.c
··· 178 178 struct inode *inode = d_inode(dentry); 179 179 struct dentry *parent; 180 180 bool parent_watched = dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED; 181 + bool parent_needed, parent_interested; 181 182 __u32 p_mask; 182 183 struct inode *p_inode = NULL; 183 184 struct name_snapshot name; ··· 194 193 return 0; 195 194 196 195 parent = NULL; 197 - if (!parent_watched && !fsnotify_event_needs_parent(inode, mnt, mask)) 196 + parent_needed = fsnotify_event_needs_parent(inode, mnt, mask); 197 + if (!parent_watched && !parent_needed) 198 198 goto notify; 199 199 200 200 /* Does parent inode care about events on children? */ ··· 207 205 208 206 /* 209 207 * Include parent/name in notification either if some notification 210 - * groups require parent info (!parent_watched case) or the parent is 211 - * interested in this event. 208 + * groups require parent info or the parent is interested in this event. 212 209 */ 213 - if (!parent_watched || (mask & p_mask & ALL_FSNOTIFY_EVENTS)) { 210 + parent_interested = mask & p_mask & ALL_FSNOTIFY_EVENTS; 211 + if (parent_needed || parent_interested) { 214 212 /* When notifying parent, child should be passed as data */ 215 213 WARN_ON_ONCE(inode != fsnotify_data_inode(data, data_type)); 216 214 217 215 /* Notify both parent and child with child name info */ 218 216 take_dentry_name_snapshot(&name, dentry); 219 217 file_name = &name.name; 220 - if (parent_watched) 218 + if (parent_interested) 221 219 mask |= FS_EVENT_ON_CHILD; 222 220 } 223 221