All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Eric Sandeen <sandeen@redhat.com>,
	linux-f2fs-devel@lists.sourceforge.net
Cc: jaegeuk@kernel.org, lihongbo22@huawei.com
Subject: Re: [f2fs-dev] [PATCH 0/9] f2fs: first steps towards mount API conversion
Date: Mon, 31 Mar 2025 16:31:48 +0800	[thread overview]
Message-ID: <c2d62ced-3a4f-442c-b438-043eec017a45@kernel.org> (raw)
In-Reply-To: <79090775-413e-437e-ab07-ac6965932a32@redhat.com>

On 3/29/25 12:18, Eric Sandeen wrote:
> I was working on next steps for this, and I have a followup question.
> 
> Today, several mount options are simply ignored if the on-disk format
> does not support them. For example:
> 
>                 case Opt_compress_mode:
>                         if (!f2fs_sb_has_compression(sbi)) {
>                                 f2fs_info(sbi, "Image doesn't support compression");
>                                 break;
>                         }
>                         name = match_strdup(&args[0]);
>                         if (!name)
>                                 return -ENOMEM;
>                         if (!strcmp(name, "fs")) {
>                                 F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
>                         } else if (!strcmp(name, "user")) {
>                                 F2FS_OPTION(sbi).compress_mode = COMPR_MODE_USER;
>                         } else {
>                                 kfree(name);
>                                 return -EINVAL;
>                         }
>                         kfree(name);
>                         break;
> 
> so if f2fs_sb_has_compression() is not true, then the option is ignored without
> any validation.
> 
> in other words, "mount -o compress_mode=nope ..." will succeed if the feature
> is disabled on the filesystem.
> 
> If I move the f2fs_sb_has_compression() check to later for the new mount API,
> then "mount -o compress_mode=nope ..."  will start failing for all images. Is
> this acceptable? It seems wise to reject invalid options rather than ignore them,
> even if they are incompatible with the format, but this would be a behavior
> change.

I'm fine w/ this change. IIRC, I haven't saw above use case, otherwise user
should stop passing invalid mount option to f2fs.

Thanks,

> 
> The above would be simple enough to defer (maybe set to COMPR_MODE_INVAL and
> reject it later) but I think other options such as compress/nocompress extensions
> would be very messy to approach as "accept all options given during parsing,
> and validate them later only if the corresponding feature is present."
> 
> So I wonder if a behavior change (stricter option validation) would be
> acceptable here?
> 
> Thanks,
> -Eric
> 



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2025-03-31  8:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 17:12 [f2fs-dev] [PATCH 0/9] f2fs: first steps towards mount API conversion Eric Sandeen
2025-03-03 17:12 ` [f2fs-dev] [PATCH 1/9] f2fs: use f2fs_sb_has_device_alias during option parsing Eric Sandeen
2025-03-12  2:54   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 2/9] f2fs: consolidate unsupported option handling errors Eric Sandeen
2025-03-12  2:54   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 3/9] f2fs: factor out an f2fs_default_check function Eric Sandeen
2025-03-12  3:10   ` Chao Yu via Linux-f2fs-devel
2025-03-12 13:29     ` Eric Sandeen
2025-03-13  1:40       ` Chao Yu via Linux-f2fs-devel
2025-03-13  1:40   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 4/9] f2fs: make INLINECRYPT a mount option flag Eric Sandeen
2025-03-12  3:28   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 5/9] f2fs: make LAZYTIME " Eric Sandeen
2025-03-12  3:30   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 6/9] f2fs: Pass sbi rather than sb to f2fs_set_test_dummy_encryption Eric Sandeen
2025-03-12  3:31   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 7/9] f2fs: defer readonly check vs norecovery Eric Sandeen
2025-03-12  3:31   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 8/9] f2fs: pass sbi rather than sb to quota qf_name helpers Eric Sandeen
2025-03-12  3:33   ` Chao Yu via Linux-f2fs-devel
2025-03-03 17:12 ` [f2fs-dev] [PATCH 9/9] f2fs: pass sbi rather than sb to parse_options() Eric Sandeen
2025-03-12  3:34   ` Chao Yu via Linux-f2fs-devel
2025-03-13 18:20 ` [f2fs-dev] [PATCH 0/9] f2fs: first steps towards mount API conversion patchwork-bot+f2fs--- via Linux-f2fs-devel
2025-03-29  4:18 ` Eric Sandeen via Linux-f2fs-devel
2025-03-31  8:31   ` Chao Yu via Linux-f2fs-devel [this message]
2025-04-01 20:33     ` Eric Sandeen via Linux-f2fs-devel
2025-04-12 17:17       ` Eric Sandeen via Linux-f2fs-devel
2025-04-14 22:14         ` Eric Sandeen via Linux-f2fs-devel

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=c2d62ced-3a4f-442c-b438-043eec017a45@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=lihongbo22@huawei.com \
    --cc=sandeen@redhat.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 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.