From: Christian Brauner <brauner@kernel.org>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Nick Terrell <terrelln@fb.com>
Cc: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Christian Brauner <brauner@kernel.org>
Subject: [PATCH 1/2] fs: indicate request originates from old mount api
Date: Mon, 26 Jun 2023 16:16:50 +0200 [thread overview]
Message-ID: <20230626-fs-btrfs-mount-api-v1-1-045e9735a00b@kernel.org> (raw)
In-Reply-To: <20230626-fs-btrfs-mount-api-v1-0-045e9735a00b@kernel.org>
We already communicate to filesystems when a remount request comes from
the old mount api as some filesystems choose to implement different
behavior in the new mount api than the old mount api to e.g., take the
chance to fix significant api bugs. Allow the same for regular mount
requests.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/namespace.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/fs/namespace.c b/fs/namespace.c
index 54847db5b819..7a74f8f703ca 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2692,7 +2692,12 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags,
if (IS_ERR(fc))
return PTR_ERR(fc);
+ /*
+ * Indicate to the filesystem that the remount request is coming
+ * from the legacy mount system call.
+ */
fc->oldapi = true;
+
err = parse_monolithic_mount_data(fc, data);
if (!err) {
down_write(&sb->s_umount);
@@ -3026,6 +3031,12 @@ static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
if (IS_ERR(fc))
return PTR_ERR(fc);
+ /*
+ * Indicate to the filesystem that the mount request is coming
+ * from the legacy mount system call.
+ */
+ fc->oldapi = true;
+
if (subtype)
err = vfs_parse_fs_string(fc, "subtype",
subtype, strlen(subtype));
--
2.34.1
next prev parent reply other threads:[~2023-06-26 14:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 14:16 [PATCH 0/2] btrfs: port to new mount api Christian Brauner
2023-06-26 14:16 ` Christian Brauner [this message]
2023-06-26 14:16 ` [PATCH 2/2] " Christian Brauner
2023-06-27 11:51 ` [PATCH 0/2] " Johannes Thumshirn
2023-06-27 14:08 ` David Sterba
2023-06-27 15:03 ` Christian Brauner
2023-06-28 11:01 ` David Sterba
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=20230626-fs-btrfs-mount-api-v1-1-045e9735a00b@kernel.org \
--to=brauner@kernel.org \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=terrelln@fb.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).