Just some language nits below... On Sun 02-12-18 13:38:25, Amir Goldstein wrote: > Add support for events with data type FSNOTIFY_EVENT_INODE > (e.g. create/attrib/move/delete) for inode and filesystem mark types. > > The "inode" events do not carry enough inormation (i.e. path) to ^^ information > report event->fd, so we do not allow setting a mask for those events > unless group supports reporting fid. > > The "inode" events are not supported on a mount mark, because they do > not carry enough inormation (i.e. path) to be filtered by mount point. ^^ information > The "dirent" events (create/move/delete) report the fid of the parent > directry where events took place without specifying the filename of the ^^ directory > @@ -326,7 +333,7 @@ static int fanotify_handle_event(struct fsnotify_group *group, > BUILD_BUG_ON(FAN_OPEN_EXEC != FS_OPEN_EXEC); > BUILD_BUG_ON(FAN_OPEN_EXEC_PERM != FS_OPEN_EXEC_PERM); > > - BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 12); > + BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 19); > > mask = fanotify_group_event_mask(group, iter_info, mask, data, > data_type); > diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c > index 8bbcf6157927..731f12cfaac8 100644 > --- a/fs/notify/fanotify/fanotify_user.c > +++ b/fs/notify/fanotify/fanotify_user.c > @@ -968,6 +968,18 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, > group->priority == FS_PRIO_0) > goto fput_and_out; > > + /* > + * Events with data type inode do not carry enough inormation to report ^^ information > + * event->fd, so we do not allow setting a mask for inode events unless > + * group supports reporting fid. > + * inode events are not supported on a mount mark, because they do not > + * carry enough inormation (i.e. path) to be filtered by mount point. ^^ information > + */ > + if (mask & FANOTIFY_INODE_EVENTS && > + (!FAN_GROUP_FLAG(group, FAN_REPORT_FID) || > + mark_type == FAN_MARK_MOUNT)) > + goto fput_and_out; > + > if (flags & FAN_MARK_FLUSH) { > ret = 0; > if (mark_type == FAN_MARK_MOUNT) Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR