• Amir Goldstein's avatar
    fsnotify: send event with parent/name info to sb/mount/non-dir marks · 9b93f331
    Amir Goldstein authored
    Similar to events "on child" to watching directory, send event
    with parent/name info if sb/mount/non-dir marks are interested in
    parent/name info.
    
    The FS_EVENT_ON_CHILD flag can be set on sb/mount/non-dir marks to specify
    interest in parent/name info for events on non-directory inodes.
    
    Events on "orphan" children (disconnected dentries) are sent without
    parent/name info.
    
    Events on directories are sent with parent/name info only if the parent
    directory is watching.
    
    After this change, even groups that do not subscribe to events on
    children could get an event with mark iterator type TYPE_CHILD and
    without mark iterator type TYPE_INODE if fanotify has marks on the same
    objects.
    
    dnotify and inotify event handlers can already cope with that situation.
    audit does not subscribe to events that are possible on child, so won't
    get to this situation. nfsd does not access the marks iterator from its
    event handler at the moment, so it is not affected.
    
    This is a bit too fragile, so we should prepare all groups to cope with
    mark type TYPE_CHILD preferably using a generic helper.
    
    Link: https://lore.kernel.org/r/20200716084230.30611-16-amir73il@gmail.comSigned-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    9b93f331
fsnotify.c 14 KB