linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Chao Yu <chao@kernel.org>, 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: Sat, 12 Apr 2025 19:17:30 +0200	[thread overview]
Message-ID: <6527ce81-e2c7-42fd-a39f-93380e133367@redhat.com> (raw)
In-Reply-To: <63ecf5bc-7ddf-4d66-9e64-9d5923d12fcd@redhat.com>

On 4/1/25 3:33 PM, Eric Sandeen wrote:
> On 3/31/25 3:31 AM, Chao Yu wrote:
>> 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.
> 
> Great, I will proceed with this. It will make the conversion simpler (but may
> make testing/validation more difficult, as behavior will change with invalid input).

FYI - I don't think I will be able to complete this conversion task myself - f2fs is
by far the most difficult conversion I've encountered, and my time for these sorts of
projects is sadly limited. I do have one more patch series that moves a lot of the
on-disk feature checking out of option parsing, and perhaps I will send it as an example
at least.

But I think it may be time to ask the f2fs experts to take over this effort, because
I'm just not getting through it on my own.

(We are down to only a small handful of filesystems left - in fact, I think only
bfs, 9p, and f2fs, that don't have patches anywhere. So it would be really great to
get some help on this.)

Thanks,
-Eric
 
> -Eric
> 
>> Thanks,



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

  reply	other threads:[~2025-04-12 17:18 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
2025-04-01 20:33     ` Eric Sandeen via Linux-f2fs-devel
2025-04-12 17:17       ` Eric Sandeen via Linux-f2fs-devel [this message]
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=6527ce81-e2c7-42fd-a39f-93380e133367@redhat.com \
    --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 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).