From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
Matthew Bobrowski <mbobrowski@mbobrowski.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux API <linux-api@vger.kernel.org>
Subject: Re: [PATCH 0/7] Report more information in fanotify dirent events
Date: Tue, 16 Nov 2021 11:12:32 +0100 [thread overview]
Message-ID: <20211116101232.GA23464@quack2.suse.cz> (raw)
In-Reply-To: <CAOQ4uxgBncZjuTo-K+vxRovd36AuaEKUfBDQwgU86B9qwWWNVw@mail.gmail.com>
On Tue 16-11-21 08:59:29, Amir Goldstein wrote:
> > > I like it. However,
> > > If FAN_RENAME can have any combination of old,new,old+new info
> > > we cannot get any with a single new into type
> > > FAN_EVENT_INFO_TYPE_DFID_NAME2
> > >
> > > (as in this posting)
> >
> > We could define only DFID2 and DFID_NAME2 but I agree it would be somewhat
> > weird to have DFID_NAME2 in an event and not DFID_NAME.
> >
> > > We can go with:
> > > #define FAN_EVENT_INFO_TYPE_OLD_DFID_NAME 6
> > > #define FAN_EVENT_INFO_TYPE_NEW_DFID_NAME 7
> > > #define FAN_EVENT_INFO_TYPE_OLD_DFID 8
> > > #define FAN_EVENT_INFO_TYPE_NEW_DFID 9
> > >
> > > Or we can go with:
> > > /* Sub-types common to all three fid info types */
> > > #define FAN_EVENT_INFO_FID_OF_OLD_DIR 1
> > > #define FAN_EVENT_INFO_FID_OF_NEW_DIR 2
> > >
> > > struct fanotify_event_info_header {
> > > __u8 info_type;
> > > __u8 sub_type;
> > > __u16 len;
> > > };
> > >
> > > (as in my wip branch fanotify_fid_of)
> >
> > When we went the way of having different types for FID and DFID, I'd
> > continue with OLD_DFID_NAME, NEW_DFID_NAME, ... and keep the padding byte
> > free for now (just in case there's some extension which would urgently need
> > it).
> >
> > > We could also have FAN_RENAME require FAN_REPORT_NAME
> > > that would limit the number of info types, but I cannot find a good
> > > justification for this requirement.
> >
> > Yeah, I would not force that.
> >
>
> On second thought and after trying to write a mental man page
> and realizing how ugly it gets, I feel strongly in favor of requiring
> FAN_REPORT_NAME for the FAN_RENAME event.
>
> My arguments are:
> 1. What is the benefit of FAN_RENAME without names?
> Is the knowledge that *something* was moved from dir A to dir B
> that important that it qualifies for the extra man page noise and
> application developer headache?
> 2. My declared motivation for this patch set was to close the last (?)
> functional gap between inotify and fanotify, that is, being able to
> reliably join MOVED_FROM and MOVED_TO events.
> Requiring FAN_REPORT_NAME still meets that goal.
> 3. In this patch set, FAN_REPORT_NAME is required (for now) for
> FAN_REPORT_TARGET_FID to reduce implementation and test
> matrix complexity (you did not object, so I wasn't planning on
> changing this requirement).
> The same argument holds for FAN_RENAME
>
> So let's say this - we can add support for OLD_DFID, NEW_DFID types
> later if we think they may serve a purpose, but at this time, I see no
> reason to complicate the UAPI anymore than it already is and I would
> rather implement only:
>
> /* Info types for FAN_RENAME */
> #define FAN_EVENT_INFO_TYPE_OLD_DFID_NAME 10
> /* Reserved for FAN_EVENT_INFO_TYPE_OLD_DFID 11 */
> #define FAN_EVENT_INFO_TYPE_NEW_DFID_NAME 12
> /* Reserved for FAN_EVENT_INFO_TYPE_NEW_DFID 13 */
>
> Do you agree?
I agree the utility of FAN_RENAME without FAN_REPORT_NAME is very limited
so I'm OK with not implementing that at least for now.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-11-16 10:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 11:40 [PATCH 0/7] Report more information in fanotify dirent events Amir Goldstein
2021-10-29 11:40 ` [PATCH 1/7] fsnotify: pass dentry instead of inode data for move events Amir Goldstein
2021-10-29 11:40 ` [PATCH 2/7] fanotify: introduce group flag FAN_REPORT_TARGET_FID Amir Goldstein
2021-10-29 11:40 ` [PATCH 3/7] fanotify: use macros to get the offset to fanotify_info buffer Amir Goldstein
2021-10-29 11:40 ` [PATCH 4/7] fanotify: support secondary dir fh and name in fanotify_info Amir Goldstein
2021-10-29 11:40 ` [PATCH 5/7] fanotify: record new parent and name in MOVED_FROM event Amir Goldstein
2021-11-12 16:48 ` Jan Kara
2021-11-13 9:40 ` Amir Goldstein
2021-11-15 8:18 ` Jan Kara
2021-10-29 11:40 ` [PATCH 6/7] fanotify: report " Amir Goldstein
2021-10-29 11:40 ` [PATCH 7/7] fanotify: enable the FAN_REPORT_TARGET_FID flag Amir Goldstein
2021-11-06 16:29 ` [PATCH 0/7] Report more information in fanotify dirent events Amir Goldstein
2021-11-12 16:39 ` Jan Kara
2021-11-13 9:49 ` Amir Goldstein
2021-11-13 19:31 ` Amir Goldstein
2021-11-15 10:23 ` Jan Kara
2021-11-15 12:22 ` Amir Goldstein
2021-11-15 14:37 ` Jan Kara
2021-11-16 6:59 ` Amir Goldstein
2021-11-16 10:12 ` Jan Kara [this message]
2021-11-18 12:47 ` Amir Goldstein
2021-11-18 16:29 ` Jan Kara
2021-11-18 16:43 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211116101232.GA23464@quack2.suse.cz \
--to=jack@suse.cz \
--cc=amir73il@gmail.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mbobrowski@mbobrowski.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).