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@vger.kernel.org
Subject: Re: [PATCH v3 07/13] fanotify: copy event fid info to user
Date: Thu, 29 Nov 2018 10:49:35 +0100 [thread overview]
Message-ID: <20181129094935.GG31087@quack2.suse.cz> (raw)
In-Reply-To: <CAOQ4uxjcb=UqQiw0XcpDfetK28bM4tOYdvgxPwhkjgE2mxpt=g@mail.gmail.com>
On Thu 29-11-18 11:27:08, Amir Goldstein wrote:
> On Thu, Nov 29, 2018, 11:00 AM Jan Kara <jack@suse.cz wrote:
>
> > On Sun 25-11-18 15:43:46, Amir Goldstein wrote:
> > > If group requested FAN_REPORT_FID and event has file identifier
> > > copy that information to user reading the event after reading
> > > event metadata.
> > > metadata->event_len includes the length of the fid information.
> > >
> > > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ...
> > > +static int round_event_fid_len(struct fsnotify_event *fsn_event)
> > > +{
> > > + struct fanotify_event *event = FANOTIFY_E(fsn_event);
> > > +
> > > + if (!FANOTIFY_HAS_FID(event))
> > > + return 0;
> > > +
> > > + return roundup(FANOTIFY_FID_INFO_LEN(event),
> > FAN_EVENT_METADATA_LEN);
> > > +}
> > > +
> >
> > Why do you round up to FAN_EVENT_METADATA_LEN? I think rounding up to
> > multiple of 8 bytes should be more than enough... Otherwise the patch looks
> > good to me.
> >
>
> Sorry for html reply . You may reply to list.
>
> I was following the practice in inotify with variable size events.
>
> I recon the reasoning is that for simplicity application define an array of
> struct metadata
> And rely on events being metadata size alligned.
>
> Not sure if that justifies the inotify practice?
Yeah, I don't think following inotify practice is really warranted here.
But thanks for explanation.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2018-11-29 20:54 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-25 13:43 [PATCH v3 00/13] fanotify: add support for more event types Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 01/13] fsnotify: annotate directory entry modification events Amir Goldstein
2018-11-28 12:59 ` Jan Kara
2018-11-28 14:39 ` Amir Goldstein
2018-11-28 14:43 ` Jan Kara
2018-11-28 15:01 ` Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 02/13] fsnotify: send all event types to super block marks Amir Goldstein
2018-11-28 14:26 ` Jan Kara
2018-11-25 13:43 ` [PATCH v3 03/13] fanotify: rename struct fanotify_{,perm_}event_info Amir Goldstein
2018-11-28 14:29 ` Jan Kara
2018-11-25 13:43 ` [PATCH v3 04/13] fanotify: define the structures to report a unique file identifier Amir Goldstein
2018-11-28 15:27 ` Jan Kara
2018-11-28 16:24 ` Amir Goldstein
2018-11-28 17:43 ` Jan Kara
2018-11-28 18:34 ` Amir Goldstein
2018-11-29 7:51 ` Jan Kara
2018-11-29 8:16 ` Amir Goldstein
2018-11-29 10:16 ` Jan Kara
2018-11-29 11:10 ` Amir Goldstein
2018-11-30 15:32 ` Amir Goldstein
2018-12-01 16:43 ` Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 05/13] fanotify: classify events that hold a " Amir Goldstein
2018-11-28 15:33 ` Jan Kara
2018-11-28 15:44 ` Jan Kara
2018-11-28 15:52 ` Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 06/13] fanotify: encode file identifier for FAN_REPORT_FID Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 07/13] fanotify: copy event fid info to user Amir Goldstein
2018-11-29 9:00 ` Jan Kara
[not found] ` <CAOQ4uxjcb=UqQiw0XcpDfetK28bM4tOYdvgxPwhkjgE2mxpt=g@mail.gmail.com>
2018-11-29 9:49 ` Jan Kara [this message]
2018-11-25 13:43 ` [PATCH v3 08/13] fanotify: enable FAN_REPORT_FID init flag Amir Goldstein
2018-11-29 9:46 ` Jan Kara
2018-11-29 10:52 ` Jan Kara
2018-11-29 11:03 ` Amir Goldstein
2018-11-29 13:08 ` Jan Kara
2018-11-25 13:43 ` [PATCH v3 09/13] fanotify: cache fsid in fsnotify_mark_connector Amir Goldstein
2018-11-29 10:48 ` Jan Kara
2018-11-29 11:42 ` Amir Goldstein
2018-11-29 13:11 ` Jan Kara
2018-11-25 13:43 ` [PATCH v3 10/13] fanotify: check FS_ISDIR flag instead of d_is_dir() Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 11/13] fanotify: support events with data type FSNOTIFY_EVENT_INODE Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 12/13] fanotify: add support for create/attrib/move/delete events Amir Goldstein
2018-11-25 13:43 ` [PATCH v3 13/13] fanotify: report FAN_ONDIR to listener with FAN_REPORT_FID 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=20181129094935.GG31087@quack2.suse.cz \
--to=jack@suse.cz \
--cc=amir73il@gmail.com \
--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).