All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Jan Kara <jack@suse.cz>, Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] fanotify: store fsid in mark instead of in connector
Date: Thu, 30 Nov 2023 15:25:39 +0100	[thread overview]
Message-ID: <20231130142539.g4hhcsk4hk2oimdv@quack3> (raw)
In-Reply-To: <20231118183018.2069899-2-amir73il@gmail.com>

On Sat 18-11-23 20:30:17, Amir Goldstein wrote:
> Some filesystems like fuse and nfs have zero or non-unique fsid.
> We would like to avoid reporting ambiguous fsid in events, so we need
> to avoid marking objects with same fsid and different sb.
> 
> To make this easier to enforce, store the fsid in the marks of the group
> instead of in the shared conenctor.
> 
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>

Very nice! I like the result. Just a few nits below.

> +static inline __kernel_fsid_t *fanotify_mark_fsid(struct fsnotify_mark *mark)
> +{
> +	return &FANOTIFY_MARK(mark)->fsid;
> +}

I guess, there's no big win in using this helper compared to using
FANOTIFY_MARK(mark)->fsid so I'd just drop this helper.

> @@ -530,6 +528,7 @@ struct fsnotify_mark {
>  #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY	0x0100
>  #define FSNOTIFY_MARK_FLAG_NO_IREF		0x0200
>  #define FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS	0x0400
> +#define FSNOTIFY_MARK_FLAG_HAS_FSID		0x0800
>  	unsigned int flags;		/* flags [mark->lock] */
>  };

So this flag is in fact private to fanotify notification framework. Either
we could just drop this flag and use

  FANOTIFY_MARK(mark)->fsid[0] != 0 || FANOTIFY_MARK(mark)->fsid[1] != 0

instead or we could at least add a comment that this flags is in fact
private to fanotify?

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2023-11-30 14:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-18 18:30 [PATCH 0/2] Support fanotify FAN_REPORT_FID on all filesystems Amir Goldstein
2023-11-18 18:30 ` [PATCH 1/2] fanotify: store fsid in mark instead of in connector Amir Goldstein
2023-11-30 14:25   ` Jan Kara [this message]
2023-11-30 15:29     ` Amir Goldstein
2023-11-30 15:50       ` Jan Kara
2023-11-18 18:30 ` [PATCH 2/2] fanotify: allow "weak" fsid when watching a single filesystem Amir Goldstein
2023-11-20  7:42   ` Amir Goldstein
2023-11-20 15:48     ` Christian Brauner
2023-11-20 16:20       ` Amir Goldstein
2023-11-21 13:33     ` Amir Goldstein
2023-11-30 12:42       ` Amir Goldstein
2023-11-30 15:47   ` Jan Kara
2023-11-30 16:28     ` 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=20231130142539.g4hhcsk4hk2oimdv@quack3 \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=brauner@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.