linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Hongbo Li <lihongbo22@huawei.com>
Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] fs: fsconfig: intercept non-new mount API in advance for FSCONFIG_CMD_CREATE_EXCL command
Date: Thu, 23 May 2024 09:35:53 +0200	[thread overview]
Message-ID: <20240523073553.llh6es6zlecblcsh@quack3> (raw)
In-Reply-To: <20240522030422.315892-1-lihongbo22@huawei.com>

On Wed 22-05-24 11:04:22, Hongbo Li wrote:
> fsconfig with FSCONFIG_CMD_CREATE_EXCL command requires the new mount api,
> here we should return -EOPNOTSUPP in advance to avoid extra procedure.
> 
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
> v2:
>   - Fix misspelling and change the target branch.
> 
> v1: https://lore.kernel.org/all/20240511062147.3312801-1-lihongbo22@huawei.com/T/
> ---
>  fs/fsopen.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/fsopen.c b/fs/fsopen.c
> index 6593ae518115..18fe979da7e2 100644
> --- a/fs/fsopen.c
> +++ b/fs/fsopen.c
> @@ -220,10 +220,6 @@ static int vfs_cmd_create(struct fs_context *fc, bool exclusive)
>  	if (!mount_capable(fc))
>  		return -EPERM;
>  
> -	/* require the new mount api */
> -	if (exclusive && fc->ops == &legacy_fs_context_ops)
> -		return -EOPNOTSUPP;
> -
>  	fc->phase = FS_CONTEXT_CREATING;
>  	fc->exclusive = exclusive;
>  
> @@ -411,6 +407,7 @@ SYSCALL_DEFINE5(fsconfig,
>  		case FSCONFIG_SET_PATH:
>  		case FSCONFIG_SET_PATH_EMPTY:
>  		case FSCONFIG_SET_FD:
> +		case FSCONFIG_CMD_CREATE_EXCL:
>  			ret = -EOPNOTSUPP;
>  			goto out_f;
>  		}
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      parent reply	other threads:[~2024-05-23  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  3:04 [PATCH v2] fs: fsconfig: intercept non-new mount API in advance for FSCONFIG_CMD_CREATE_EXCL command Hongbo Li
2024-05-22  7:11 ` Christian Brauner
2024-05-23  7:35 ` Jan Kara [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=20240523073553.llh6es6zlecblcsh@quack3 \
    --to=jack@suse.cz \
    --cc=brauner@kernel.org \
    --cc=lihongbo22@huawei.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 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).