mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: chao@kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: allow empty mount string for Opt_usr|grp|projjquota
Date: Mon, 13 Apr 2026 17:40:33 +0800	[thread overview]
Message-ID: <5cf2e3ba-c222-4ffb-8238-45d641f6f7c7@kernel.org> (raw)
In-Reply-To: <20260331174326.231867-1-jaegeuk@kernel.org>

On 4/1/2026 1:43 AM, Jaegeuk Kim via Linux-f2fs-devel wrote:
> The fsparam_string_empty() gives an error when mounting without string, since
> its type is set to fsparam_flag in VFS. So, let's allow the flag as well.
> 
> This addresses xfstests/f2fs/015 and f2fs/021.
> 

Fixes: d18535132523 ("f2fs: separate the options parsing and options checking") ?

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>   fs/f2fs/super.c | 27 +++++++++++++++------------
>   1 file changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 5330ef981340..aab4345f3ee7 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -337,9 +337,12 @@ static const struct fs_parameter_spec f2fs_param_specs[] = {
>   	fsparam_flag("usrquota", Opt_usrquota),
>   	fsparam_flag("grpquota", Opt_grpquota),
>   	fsparam_flag("prjquota", Opt_prjquota),
> -	fsparam_string_empty("usrjquota", Opt_usrjquota),
> -	fsparam_string_empty("grpjquota", Opt_grpjquota),
> -	fsparam_string_empty("prjjquota", Opt_prjjquota),
> +	fsparam_string("usrjquota", Opt_usrjquota),
> +	fsparam_flag("usrjquota", Opt_usrjquota),
> +	fsparam_string("grpjquota", Opt_grpjquota),
> +	fsparam_flag("grpjquota", Opt_grpjquota),
> +	fsparam_string("prjjquota", Opt_prjjquota),
> +	fsparam_flag("prjjquota", Opt_prjjquota),
>   	fsparam_flag("nat_bits", Opt_nat_bits),
>   	fsparam_enum("jqfmt", Opt_jqfmt, f2fs_param_jqfmt),
>   	fsparam_enum("alloc_mode", Opt_alloc, f2fs_param_alloc_mode),
> @@ -980,26 +983,26 @@ static int f2fs_parse_param(struct fs_context *fc, struct fs_parameter *param)
>   		ctx_set_opt(ctx, F2FS_MOUNT_PRJQUOTA);
>   		break;
>   	case Opt_usrjquota:
> -		if (!*param->string)
> -			ret = f2fs_unnote_qf_name(fc, USRQUOTA);
> -		else
> +		if (param->type == fs_value_is_string && *param->string)
>   			ret = f2fs_note_qf_name(fc, USRQUOTA, param);
> +		else
> +			ret = f2fs_unnote_qf_name(fc, USRQUOTA);
>   		if (ret)
>   			return ret;
>   		break;
>   	case Opt_grpjquota:
> -		if (!*param->string)
> -			ret = f2fs_unnote_qf_name(fc, GRPQUOTA);
> -		else
> +		if (param->type == fs_value_is_string && *param->string)
>   			ret = f2fs_note_qf_name(fc, GRPQUOTA, param);
> +		else
> +			ret = f2fs_unnote_qf_name(fc, GRPQUOTA);
>   		if (ret)
>   			return ret;
>   		break;
>   	case Opt_prjjquota:
> -		if (!*param->string)
> -			ret = f2fs_unnote_qf_name(fc, PRJQUOTA);
> -		else
> +		if (param->type == fs_value_is_string && *param->string)
>   			ret = f2fs_note_qf_name(fc, PRJQUOTA, param);
> +		else
> +			ret = f2fs_unnote_qf_name(fc, PRJQUOTA);
>   		if (ret)
>   			return ret;
>   		break;


  parent reply	other threads:[~2026-04-13  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 17:43 Jaegeuk Kim
2026-04-06 16:07 ` [f2fs-dev] " Daeho Jeong
2026-04-06 16:59 ` [PATCH v2] " Jaegeuk Kim
2026-04-06 17:34   ` [f2fs-dev] " Daeho Jeong
2026-04-13  9:40 ` Chao Yu [this message]
2026-04-13 23:00 ` [f2fs-dev] [PATCH] " patchwork-bot+f2fs

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=5cf2e3ba-c222-4ffb-8238-45d641f6f7c7@kernel.org \
    --to=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome