All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH v2 3/3] fanotify: support setting marks in btrfs sub-volumes
Date: Thu, 26 Oct 2023 18:52:24 +0300	[thread overview]
Message-ID: <20231026155224.129326-4-amir73il@gmail.com> (raw)
In-Reply-To: <20231026155224.129326-1-amir73il@gmail.com>

Setting fanotify marks that report events with fid on btrfs sub-volumes
was not supported, because in the case of btrfs sub-volumes, there is no
uniform fsid that can be reported in events.

Now that we report the fsid on the object whose path was used to setup
the mark, we can allow support setting marks in btrfs sub-volumes.

Users that make multiple fanotify_mark(2) calls on the same filesystem
are expected to call statfs(2) on every path were a mark was setup and
can expect that any of those fsid could be reported in any of the events.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 fs/notify/fanotify/fanotify_user.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index fdd39bf91806..59a7a720fd08 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -1566,7 +1566,6 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
 
 static int fanotify_test_fsid(struct dentry *dentry, __kernel_fsid_t *fsid)
 {
-	__kernel_fsid_t root_fsid;
 	int err;
 
 	/*
@@ -1579,18 +1578,6 @@ static int fanotify_test_fsid(struct dentry *dentry, __kernel_fsid_t *fsid)
 	if (!fsid->val[0] && !fsid->val[1])
 		return -ENODEV;
 
-	/*
-	 * Make sure dentry is not of a filesystem subvolume (e.g. btrfs)
-	 * which uses a different fsid than sb root.
-	 */
-	err = vfs_get_fsid(dentry->d_sb->s_root, &root_fsid);
-	if (err)
-		return err;
-
-	if (root_fsid.val[0] != fsid->val[0] ||
-	    root_fsid.val[1] != fsid->val[1])
-		return -EXDEV;
-
 	return 0;
 }
 
-- 
2.34.1


  parent reply	other threads:[~2023-10-26 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 15:52 [PATCH v2 0/3] fanotify support for btrfs sub-volumes Amir Goldstein
2023-10-26 15:52 ` [PATCH v2 1/3] fanotify: store fsid in mark instead of in connector Amir Goldstein
2023-10-26 15:52 ` [PATCH v2 2/3] fanotify: report the most specific fsid for btrfs Amir Goldstein
2023-10-26 15:52 ` Amir Goldstein [this message]
2023-10-26 16:09 ` [PATCH v2 0/3] fanotify support for btrfs sub-volumes Jan Kara
2023-10-27  5:46 ` Christoph Hellwig
2023-10-27  6:03   ` Amir Goldstein
2023-10-27  6:08     ` Christoph Hellwig
2023-10-27  6:33       ` Amir Goldstein
2023-10-27  7:30         ` Christoph Hellwig
2023-10-27 15:47           ` Jan Kara

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=20231026155224.129326-4-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@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
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.