From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:46242 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725958AbfADK0p (ORCPT ); Fri, 4 Jan 2019 05:26:45 -0500 Date: Fri, 4 Jan 2019 11:26:43 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v4 14/15] fanotify: add support for create/attrib/move/delete events Message-ID: <20190104102643.GI22409@quack2.suse.cz> References: <20181202113826.32133-1-amir73il@gmail.com> <20181202113826.32133-15-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181202113826.32133-15-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 SUSE Labs, CR