linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Marko Rauhamaa <marko.rauhamaa@f-secure.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-api@vger.kernel.org
Subject: Re: [PATCH v3 3/3] fanotify: add API to attach/detach super block mark
Date: Mon, 3 Sep 2018 12:58:02 +0300	[thread overview]
Message-ID: <CAOQ4uxjjQ9p-59vd-Sku5KRDcKMOO0o05Be2Gai+wN8CjG1Zvg@mail.gmail.com> (raw)
In-Reply-To: <20180903084859.GC10027@quack2.suse.cz>

On Mon, Sep 3, 2018 at 11:49 AM Jan Kara <jack@suse.cz> wrote:
>
> On Fri 31-08-18 18:30:32, Amir Goldstein wrote:
> > On Fri, Aug 31, 2018 at 5:05 PM Jan Kara <jack@suse.cz> wrote:
> > >
> > > On Thu 30-08-18 18:15:51, Amir Goldstein wrote:
> > > > Add another mark type flag FAN_MARK_FILESYSTEM for add/remove/flush
> > > > of super block mark type.
> > > >
> > > > A super block watch gets all events on the filesystem, regardless of
> > > > the mount from which the mark was added, unless an ignore mask exists
> > > > on either the inode or the mount where the event was generated.
> > > >
> > > > Only one of FAN_MARK_MOUNT and FAN_MARK_FILESYSTEM mark type flags
> > > > may be provided to fanotify_mark() or no mark type flag for inode mark.
> > > >
> > > > Cc: <linux-api@vger.kernel.org>
> > > > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > >
[...]
> > Shall I go as far as:
> > #define FAN_MARK_TYPE_BIT1      0x00000010
> > #define FAN_MARK_TYPE_BIT2      0x00000100
> > #define FAN_MARK_TYPE_MASK (FAN_MARK_TYPE_BIT1 | FAN_MARK_TYPE_BIT2)
> >
> > /* mark type can be a combination of mark type bits */
> > #define FAN_MARK_INODE          0
> > #define FAN_MARK_MOUNT          FAN_MARK_TYPE_BIT1
> > #define FAN_MARK_FILESYSTEM     FAN_MARK_TYPE_BIT2
>
> Probably I would not go as far as defining FAN_MARK_TYPE_BIT?. That looks a
> bit confusing and it's in userspace-visible headers. I'd just define the
> mask and add it into FAN_ALL_MARK_FLAGS instead of FAN_MARK_MOUNT. That
> should protect us (together with flags & supported-type checks in
> do_fanotify_mark()) against messing up the definitions (at least I hope ;).
>

That's what I figured.. already posted v4 with a comment similar to
that in the similar case of FAN_ALL_CLASS_BITS.

Thanks,
Amir.

      reply	other threads:[~2018-09-03 14:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 15:15 [PATCH v3 0/3] fanotify super block marks Amir Goldstein
2018-08-30 15:15 ` [PATCH v3 1/3] fsnotify: add super block object type Amir Goldstein
2018-08-31 13:52   ` Jan Kara
2018-08-30 15:15 ` [PATCH v3 2/3] fsnotify: send path type events to group with super block marks Amir Goldstein
2018-08-31 13:50   ` Jan Kara
2018-08-31 15:07     ` Amir Goldstein
2018-09-03  8:36       ` Jan Kara
2018-08-30 15:15 ` [PATCH v3 3/3] fanotify: add API to attach/detach super block mark Amir Goldstein
2018-08-31 14:05   ` Jan Kara
2018-08-31 15:30     ` Amir Goldstein
2018-09-03  8:48       ` Jan Kara
2018-09-03  9:58         ` Amir Goldstein [this message]

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=CAOQ4uxjjQ9p-59vd-Sku5KRDcKMOO0o05Be2Gai+wN8CjG1Zvg@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=marko.rauhamaa@f-secure.com \
    /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).