Linux-Fsdevel Archive on lore.kernel.org
 help / color / Atom feed
From: Matthew Bobrowski <repnop@google.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Linux API <linux-api@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/2] fanotify: Add pidfd support to the fanotify API
Date: Thu, 29 Apr 2021 08:53:31 +1000
Message-ID: <YInna8fT/WfUkV6+@google.com> (raw)
In-Reply-To: <CAOQ4uxjAqh3xVpigrJe1k01Fy5-rJRxxLGw92BwWtU4zjr=Wjg@mail.gmail.com>

On Tue, Apr 27, 2021 at 08:14:05AM +0300, Amir Goldstein wrote:
> On Tue, Apr 27, 2021 at 6:35 AM Matthew Bobrowski <repnop@google.com> wrote:
> >
> > On Mon, Apr 26, 2021 at 02:11:30PM +0300, Amir Goldstein wrote:
> > > > Amir, I was just thinking about this a little over the weekend and I
> > > > don't think we discussed how to handle the FAN_REPORT_PIDFD |
> > > > FAN_REPORT_FID and friends case? My immediate thought is to make
> > > > FAN_REPORT_PIDFD mutually exclusive with FAN_REPORT_FID and friends,
> > > > but then again receiving a pidfd along with FID events may be also
> > > > useful for some? What are your thoughts on this? If we don't go ahead
> > > > with mutual exclusion, then this multiple event types alongside struct
> > > > fanotify_event_metadata starts getting a little clunky, don't you
> > > > think?
> > > >
> > >
> > > The current format of an fanotify event already supports multiple info records:
> > >
> > > [fanotify_event_metadata]
> > > [[fanotify_event_info_header][event record #1]]
> > > [[fanotify_event_info_header][event record #2]]...
> > >
> > > (meta)->event_len is the total event length including all info records.
> > >
> > > For example, FAN_REPORT_FID | FAN_REPORT_DFID_MAME produces
> > > (for some events) two info records, one FAN_EVENT_INFO_TYPE_FID
> > > record and one FAN_EVENT_INFO_TYPE_DFID_NAME record.
> >
> > Ah, that's right! I now remember reviewing some patches associated
> > with the FID change series which mentioned the possibility of
> > receiving multiple FID info records. As the implementation currently
> > stands, AFAIK there's not possibility for fanotify to ever return more
> > than two info records, right?
> >
> > Is there any preference in terms of whether the new FAN_REPORT_PIDFD
> > info records precede or come after FAN_REPORT_FID/FAN_REPORT_DFID_NAME
> > info records in FAN_REPORT_FID or FAN_REPORT_FID |
> > FAN_REPORT_DFID_NAME configurations?
>
> Doesn't matter.

OK, fair.

> Your typical application would first filter by pid/pidfd and only if process
> matches the filters would it care to examine the event fid info, correct?

Not necessarily, but you're right, the ordering doesn't really matter
too much.

/M

  reply index

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 23:21 [PATCH 0/2] fanotify: Adding " Matthew Bobrowski
2021-04-15 23:22 ` [PATCH 1/2] pidfd_create(): remove static qualifier and declare pidfd_create() in linux/pid.h Matthew Bobrowski
2021-04-19 10:13   ` Jan Kara
2021-04-19 12:50   ` Christian Brauner
2021-04-20  0:17     ` Matthew Bobrowski
2021-04-15 23:22 ` [PATCH 2/2] fanotify: Add pidfd support to the fanotify API Matthew Bobrowski
2021-04-16  6:27   ` Amir Goldstein
2021-04-16  7:05     ` Matthew Bobrowski
2021-04-16  7:53       ` Amir Goldstein
2021-04-16  8:08         ` Matthew Bobrowski
2021-04-19 13:02     ` Christian Brauner
2021-04-19 10:21   ` Jan Kara
2021-04-20  1:35     ` Matthew Bobrowski
2021-04-19 13:20   ` Christian Brauner
2021-04-19 13:53     ` Amir Goldstein
2021-04-19 14:44       ` Christian Brauner
2021-04-19 13:55     ` Jan Kara
2021-04-19 15:02       ` Christian Brauner
2021-04-20  2:36         ` Matthew Bobrowski
2021-04-21  8:04           ` Jan Kara
2021-04-21  9:29             ` Amir Goldstein
2021-04-21 10:00               ` Jan Kara
2021-04-21 10:12                 ` Amir Goldstein
2021-04-21 13:48                   ` Jan Kara
2021-04-21 14:46                     ` Christian Brauner
2021-04-22 23:06             ` Matthew Bobrowski
2021-04-23  7:39               ` Amir Goldstein
2021-04-23  8:02                 ` Matthew Bobrowski
2021-04-23  8:14                   ` Amir Goldstein
2021-04-26 10:26                     ` Matthew Bobrowski
2021-04-26 11:11                       ` Amir Goldstein
2021-04-27  3:35                         ` Matthew Bobrowski
2021-04-27  5:14                           ` Amir Goldstein
2021-04-28 22:53                             ` Matthew Bobrowski [this message]
2021-04-19 12:34 ` [PATCH 0/2] fanotify: Adding " Christian Brauner

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=YInna8fT/WfUkV6+@google.com \
    --to=repnop@google.com \
    --cc=amir73il@gmail.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=jack@suse.cz \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.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

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git