aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gcc-plugins/gcc-common.h
diff options
context:
space:
mode:
authorAmir Goldstein <[email protected]>2020-11-08 10:59:06 +0000
committerJan Kara <[email protected]>2020-11-09 14:03:08 +0000
commit7372e79c9eb9d7034e498721eb2861ae4fdbc618 (patch)
treecf7bed398f1f0dc95f9dfec6f5b7119a0df1f972 /scripts/gcc-plugins/gcc-common.h
parentMerge branch 'akpm' (patches from Andrew) (diff)
downloadkernel-7372e79c9eb9d7034e498721eb2861ae4fdbc618.tar.gz
kernel-7372e79c9eb9d7034e498721eb2861ae4fdbc618.zip
fanotify: fix logic of reporting name info with watched parent
The victim inode's parent and name info is required when an event needs to be delivered to a group interested in filename info OR when the inode's parent is interested in an event on its children. Let us call the first condition 'parent_needed' and the second condition 'parent_interested'. In fsnotify_parent(), the condition where the inode's parent is interested in some events on its children, but not necessarily interested the specific event is called 'parent_watched'. fsnotify_parent() tests the condition (!parent_watched && !parent_needed) for sending the event without parent and name info, which is correct. It then wrongly assumes that parent_watched implies !parent_needed and tests the condition (parent_watched && !parent_interested) for sending the event without parent and name info, which is wrong, because parent may still be needed by some group. For example, after initializing a group with FAN_REPORT_DFID_NAME and adding a FAN_MARK_MOUNT with FAN_OPEN mask, open events on non-directory children of "testdir" are delivered with file name info. After adding another mark to the same group on the parent "testdir" with FAN_CLOSE|FAN_EVENT_ON_CHILD mask, open events on non-directory children of "testdir" are no longer delivered with file name info. Fix the logic and use auxiliary variables to clarify the conditions. Fixes: 9b93f33105f5 ("fsnotify: send event with parent/name info to sb/mount/non-dir marks") Cc: [email protected]#v5.9 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Amir Goldstein <[email protected]> Signed-off-by: Jan Kara <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/gcc-common.h')
0 files changed, 0 insertions, 0 deletions