On Thu, Jul 16, 2020 at 8:57 PM Jan Kara <jack@xxxxxxx> wrote: > > On Thu 16-07-20 20:20:04, Amir Goldstein wrote: > > On Thu, Jul 16, 2020 at 8:01 PM Jan Kara <jack@xxxxxxx> wrote: > > > > > > On Thu 16-07-20 11:42:23, Amir Goldstein wrote: > > > > Similar to events "on child" to watching directory, send event "on child" > > > > 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 direcories are send with parent/name info only if the parent > > > > directory is watching. > > > > > > > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > > > > > > Hum, doesn't this break ignore mask handling in > > > fanotify_group_event_mask()? Because parent's ignore mask will be included > > > even though parent is added into the iter only to carry the parent info... > > > > > > > Hmm, break ignore mask handling? or fix it? > > > > Man page said: > > "Having these two types of masks permits a mount point or directory to be > > marked for receiving events, while at the same time ignoring events for > > specific objects under that mount point or directory." > > Right, but presumably that speaks of the case of a mark where the parent > has FS_EVENT_ON_CHILD set. For case of parent watching events of a child, I > agree it makes sense to apply ignore masks of both the parent and the child. > > > The author did not say what to expect from marking a mount and ignoring > > a directory. > > Yes and I'd expect to apply ignore mask on events for that directory but > not for events on files in that directory... Even more so because this will > be currently inconsistent wrt whether the child is dir (parent's ignore mask > does not apply) or file (parent's ignore mask does apply). > Indeed. For that I used this trick in my POC: /* Set the mark mask, so fsnotify_parent() will find this mark */ ovm->fsn_mark.mask = mask | FS_EVENT_ON_CHILD; ovm->fsn_mark.ignored_mask = mask; It's not how users are expected to configure an ignored mask on children but we can work the ignored mask information into the object mask, like I already did w.r.t FS_MODIFY and get the same result without the hack. Thanks, Amir. P.S. for whoever is interested, my POC is on ovl-fsnotify branch. It seems to be working well. I am just trying to get those "ephemeral exclude marks" to not pin the dir inodes to cache, so that those inodes could be evicted.