From: Christoph Hellwig <hch@lst.de>
To: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>,
Al Viro <viro@zeniv.linux.org.uk>,
David Howells <dhowells@redhat.com>,
Aleksa Sarai <cyphar@cyphar.com>, Karel Zak <kzak@redhat.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH RFC 3/3] fs: add FSCONFIG_CMD_CREATE_EXCL
Date: Tue, 1 Aug 2023 17:46:07 +0200 [thread overview]
Message-ID: <20230801154607.GD12035@lst.de> (raw)
In-Reply-To: <20230801-vfs-super-exclusive-v1-3-1a587e56c9f3@kernel.org>
> + /* require the new mount api */
> + if (exclusive && (fc->ops == &legacy_fs_context_ops))
No need for the inner braces.
> + return -EOPNOTSUPP;
> +
> fc->phase = FS_CONTEXT_CREATING;
> + fc->exclusive = exclusive;
>
> ret = vfs_get_tree(fc);
> - if (ret)
> + if (ret) {
> + fc->exclusive = false;
What's the point in clearing the flag on error?
> + case FSCONFIG_CMD_CREATE_EXCL:
> + fallthrough;
> case FSCONFIG_CMD_CREATE:
> - ret = vfs_cmd_create(fc);
> + ret = vfs_cmd_create(fc, cmd == FSCONFIG_CMD_CREATE_EXCL);
> if (ret)
> break;
> return 0;
Nitpick, but I always find it cleaner to do something like:
case FSCONFIG_CMD_CREATE_EXCL:
ret = vfs_cmd_create(fc, true)
break;
case FSCONFIG_CMD_CREATE:
ret = vfs_cmd_create(fc, false);
but that might just be preference.
next prev parent reply other threads:[~2023-08-01 15:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 13:08 [PATCH RFC 0/3] fs: allow userspace to detect superblock reuse Christian Brauner
2023-08-01 13:09 ` [PATCH RFC 1/3] super: remove get_tree_single_reconf() Christian Brauner
2023-08-01 15:31 ` Christoph Hellwig
2023-08-02 7:20 ` Christian Brauner
2023-08-02 16:49 ` Jan Kara
2023-08-01 13:09 ` [PATCH RFC 2/3] fs: add vfs_cmd_create() Christian Brauner
2023-08-01 15:43 ` Christoph Hellwig
2023-08-01 15:48 ` Christoph Hellwig
2023-08-02 8:02 ` Christian Brauner
2023-08-02 17:01 ` Jan Kara
2023-08-02 17:13 ` Jan Kara
2023-08-01 13:09 ` [PATCH RFC 3/3] fs: add FSCONFIG_CMD_CREATE_EXCL Christian Brauner
2023-08-01 15:46 ` Christoph Hellwig [this message]
2023-08-02 7:38 ` Christian Brauner
2023-08-01 14:25 ` [PATCH RFC 0/3] fs: allow userspace to detect superblock reuse Josef Bacik
2023-08-02 7:49 ` 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=20230801154607.GD12035@lst.de \
--to=hch@lst.de \
--cc=brauner@kernel.org \
--cc=cyphar@cyphar.com \
--cc=dhowells@redhat.com \
--cc=jack@suse.cz \
--cc=kzak@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.