When reporting event with parent/name info, we should not skip sb/mount marks mask if event has FAN_EVENT_ON_CHILD in the mask. This check is a leftover from the time when the event on child was reported in a separate callback than the event on parent and we did not want to get duplicate events for sb/mount mark. Fixes: eca4784cbb18 ("fsnotify: send event to parent and child with single callback") Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> --- fs/notify/fanotify/fanotify.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index a24f08a9c50f..36ea0cd6387e 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -265,13 +265,11 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group, continue; /* - * If the event is for a child and this mark doesn't care about - * events on a child, don't send it! - * The special object type "child" always cares about events on - * a child, because it refers to the child inode itself. + * If the event is for a child and this mark is on a parent not + * watching children, don't send it! */ if (event_mask & FS_EVENT_ON_CHILD && - type != FSNOTIFY_OBJ_TYPE_CHILD && + type == FSNOTIFY_OBJ_TYPE_INODE && !(mark->mask & FS_EVENT_ON_CHILD)) continue; -- 2.17.1