mbox series

[f2fs-dev,0/9] f2fs: new mount API conversion

Message ID 20240814023912.3959299-1-lihongbo22@huawei.com (mailing list archive)
Headers show
Series f2fs: new mount API conversion | expand

Message

Hongbo Li Aug. 14, 2024, 2:39 a.m. UTC
Since many filesystems have done the new mount API conversion,
we introduce the new mount API conversion in f2fs.

The series can be applied on top of the current mainline tree
and the work is based on the patches from Lukas Czerner (has
done this in ext4[1]). His patch give me a lot of ideas.

Here is a high level description of the patchset:

1. Prepare the f2fs mount parameters required by the new mount
API and use it for parsing, while still using the old API to
get mount options string. Split the parameter parsing and
validation of the parse_options helper into two separate
helpers.

  f2fs: Add fs parameter specifications for mount options
  f2fs: move the option parser into handle_mount_opt
  f2fs: move option validation into a separate helper

2. Remove the use of sb/sbi structure of f2fs from all the
parsing code, because with the new mount API the parsing is
going to be done before we even get the super block. In this
part, we introduce f2fs_fs_context to hold the temporary
options when parsing. For the simple options check, it has
to be done during parsing by using f2fs_fs_context structure.
For the check which needs sb/sbi, we do this during super
block filling.

  f2fs: Allow sbi to be NULL in f2fs_printk
  f2fs: Add f2fs_fs_context to record the mount options
  f2fs: separate the options parsing and options checking

3. Switch the f2fs to use the new mount API for mount and
remount.

  f2fs: introduce fs_context_operation structure
  f2fs: switch to the new mount api

4. Cleanup the old unused structures and helpers.

  f2fs: remove unused structure and functions

There is still a potential to do some cleanups and perhaps
refactoring. However that can be done later after the conversion
to the new mount API which is the main purpose of the patchset.

[1] https://lore.kernel.org/all/20211021114508.21407-1-lczerner@redhat.com/

Hongbo Li (9):
  f2fs: Add fs parameter specifications for mount options
  f2fs: move the option parser into handle_mount_opt
  f2fs: move option validation into a separate helper
  f2fs: Allow sbi to be NULL in f2fs_printk
  f2fs: Add f2fs_fs_context to record the mount options
  f2fs: separate the options parsing and options checking
  f2fs: introduce fs_context_operation structure
  f2fs: switch to the new mount api
  f2fs: remove unused structure and functions

 fs/f2fs/super.c | 2211 ++++++++++++++++++++++++++++-------------------
 1 file changed, 1341 insertions(+), 870 deletions(-)

Comments

Hongbo Li Aug. 27, 2024, 11:47 a.m. UTC | #1
Does there exist CI test for f2fs? I can only write the mount test for 
f2fs refer to tests/ext4/053. And I have tested this in local.

Thanks,
Hongbo

On 2024/8/14 10:39, Hongbo Li wrote:
> Since many filesystems have done the new mount API conversion,
> we introduce the new mount API conversion in f2fs.
> 
> The series can be applied on top of the current mainline tree
> and the work is based on the patches from Lukas Czerner (has
> done this in ext4[1]). His patch give me a lot of ideas.
> 
> Here is a high level description of the patchset:
> 
> 1. Prepare the f2fs mount parameters required by the new mount
> API and use it for parsing, while still using the old API to
> get mount options string. Split the parameter parsing and
> validation of the parse_options helper into two separate
> helpers.
> 
>    f2fs: Add fs parameter specifications for mount options
>    f2fs: move the option parser into handle_mount_opt
>    f2fs: move option validation into a separate helper
> 
> 2. Remove the use of sb/sbi structure of f2fs from all the
> parsing code, because with the new mount API the parsing is
> going to be done before we even get the super block. In this
> part, we introduce f2fs_fs_context to hold the temporary
> options when parsing. For the simple options check, it has
> to be done during parsing by using f2fs_fs_context structure.
> For the check which needs sb/sbi, we do this during super
> block filling.
> 
>    f2fs: Allow sbi to be NULL in f2fs_printk
>    f2fs: Add f2fs_fs_context to record the mount options
>    f2fs: separate the options parsing and options checking
> 
> 3. Switch the f2fs to use the new mount API for mount and
> remount.
> 
>    f2fs: introduce fs_context_operation structure
>    f2fs: switch to the new mount api
> 
> 4. Cleanup the old unused structures and helpers.
> 
>    f2fs: remove unused structure and functions
> 
> There is still a potential to do some cleanups and perhaps
> refactoring. However that can be done later after the conversion
> to the new mount API which is the main purpose of the patchset.
> 
> [1] https://lore.kernel.org/all/20211021114508.21407-1-lczerner@redhat.com/
> 
> Hongbo Li (9):
>    f2fs: Add fs parameter specifications for mount options
>    f2fs: move the option parser into handle_mount_opt
>    f2fs: move option validation into a separate helper
>    f2fs: Allow sbi to be NULL in f2fs_printk
>    f2fs: Add f2fs_fs_context to record the mount options
>    f2fs: separate the options parsing and options checking
>    f2fs: introduce fs_context_operation structure
>    f2fs: switch to the new mount api
>    f2fs: remove unused structure and functions
> 
>   fs/f2fs/super.c | 2211 ++++++++++++++++++++++++++++-------------------
>   1 file changed, 1341 insertions(+), 870 deletions(-)
>
Eric Sandeen Aug. 30, 2024, 5:07 p.m. UTC | #2
Just FWIW - 

I had missed this thread when I got temporarily unsubscribed from fsdevel.
I have a series that I was hacking on for this same work, at
https://git.kernel.org/pub/scm/linux/kernel/git/sandeen/linux.git/commit/?h=f2fs-mount-api
but it's very rough and almost certainly contains bugs. It may or may not
be of any help to you, but just FYI.

I'll try to help review/test your series since I tried to solve this as
well, but I never completed the work. :)

Thanks,
-Eric

On 8/27/24 6:47 AM, Hongbo Li wrote:
> Does there exist CI test for f2fs? I can only write the mount test for f2fs refer to tests/ext4/053. And I have tested this in local.
> 
> Thanks,
> Hongbo
> 
> On 2024/8/14 10:39, Hongbo Li wrote:
>> Since many filesystems have done the new mount API conversion,
>> we introduce the new mount API conversion in f2fs.
>>
>> The series can be applied on top of the current mainline tree
>> and the work is based on the patches from Lukas Czerner (has
>> done this in ext4[1]). His patch give me a lot of ideas.
>>
>> Here is a high level description of the patchset:
>>
>> 1. Prepare the f2fs mount parameters required by the new mount
>> API and use it for parsing, while still using the old API to
>> get mount options string. Split the parameter parsing and
>> validation of the parse_options helper into two separate
>> helpers.
>>
>>    f2fs: Add fs parameter specifications for mount options
>>    f2fs: move the option parser into handle_mount_opt
>>    f2fs: move option validation into a separate helper
>>
>> 2. Remove the use of sb/sbi structure of f2fs from all the
>> parsing code, because with the new mount API the parsing is
>> going to be done before we even get the super block. In this
>> part, we introduce f2fs_fs_context to hold the temporary
>> options when parsing. For the simple options check, it has
>> to be done during parsing by using f2fs_fs_context structure.
>> For the check which needs sb/sbi, we do this during super
>> block filling.
>>
>>    f2fs: Allow sbi to be NULL in f2fs_printk
>>    f2fs: Add f2fs_fs_context to record the mount options
>>    f2fs: separate the options parsing and options checking
>>
>> 3. Switch the f2fs to use the new mount API for mount and
>> remount.
>>
>>    f2fs: introduce fs_context_operation structure
>>    f2fs: switch to the new mount api
>>
>> 4. Cleanup the old unused structures and helpers.
>>
>>    f2fs: remove unused structure and functions
>>
>> There is still a potential to do some cleanups and perhaps
>> refactoring. However that can be done later after the conversion
>> to the new mount API which is the main purpose of the patchset.
>>
>> [1] https://lore.kernel.org/all/20211021114508.21407-1-lczerner@redhat.com/
>>
>> Hongbo Li (9):
>>    f2fs: Add fs parameter specifications for mount options
>>    f2fs: move the option parser into handle_mount_opt
>>    f2fs: move option validation into a separate helper
>>    f2fs: Allow sbi to be NULL in f2fs_printk
>>    f2fs: Add f2fs_fs_context to record the mount options
>>    f2fs: separate the options parsing and options checking
>>    f2fs: introduce fs_context_operation structure
>>    f2fs: switch to the new mount api
>>    f2fs: remove unused structure and functions
>>
>>   fs/f2fs/super.c | 2211 ++++++++++++++++++++++++++++-------------------
>>   1 file changed, 1341 insertions(+), 870 deletions(-)
>>
>
Hongbo Li Aug. 31, 2024, 1:45 a.m. UTC | #3
On 2024/8/31 1:07, Eric Sandeen wrote:
> Just FWIW -
> 
> I had missed this thread when I got temporarily unsubscribed from fsdevel.
> I have a series that I was hacking on for this same work, at
> https://git.kernel.org/pub/scm/linux/kernel/git/sandeen/linux.git/commit/?h=f2fs-mount-api
> but it's very rough and almost certainly contains bugs. It may or may not
> be of any help to you, but just FYI.
> 
> I'll try to help review/test your series since I tried to solve this as
> well, but I never completed the work. :)

That will be great! Thank you very much!
There is still a lot of refactoring that can be done. At the time, the 
consideration was to make the smallest possible changes, so many places 
were essentially preserved. We can work together to make this better.

Thanks,
Hongbo

> 
> Thanks,
> -Eric
> 
> On 8/27/24 6:47 AM, Hongbo Li wrote:
>> Does there exist CI test for f2fs? I can only write the mount test for f2fs refer to tests/ext4/053. And I have tested this in local.
>>
>> Thanks,
>> Hongbo
>>
>> On 2024/8/14 10:39, Hongbo Li wrote:
>>> Since many filesystems have done the new mount API conversion,
>>> we introduce the new mount API conversion in f2fs.
>>>
>>> The series can be applied on top of the current mainline tree
>>> and the work is based on the patches from Lukas Czerner (has
>>> done this in ext4[1]). His patch give me a lot of ideas.
>>>
>>> Here is a high level description of the patchset:
>>>
>>> 1. Prepare the f2fs mount parameters required by the new mount
>>> API and use it for parsing, while still using the old API to
>>> get mount options string. Split the parameter parsing and
>>> validation of the parse_options helper into two separate
>>> helpers.
>>>
>>>     f2fs: Add fs parameter specifications for mount options
>>>     f2fs: move the option parser into handle_mount_opt
>>>     f2fs: move option validation into a separate helper
>>>
>>> 2. Remove the use of sb/sbi structure of f2fs from all the
>>> parsing code, because with the new mount API the parsing is
>>> going to be done before we even get the super block. In this
>>> part, we introduce f2fs_fs_context to hold the temporary
>>> options when parsing. For the simple options check, it has
>>> to be done during parsing by using f2fs_fs_context structure.
>>> For the check which needs sb/sbi, we do this during super
>>> block filling.
>>>
>>>     f2fs: Allow sbi to be NULL in f2fs_printk
>>>     f2fs: Add f2fs_fs_context to record the mount options
>>>     f2fs: separate the options parsing and options checking
>>>
>>> 3. Switch the f2fs to use the new mount API for mount and
>>> remount.
>>>
>>>     f2fs: introduce fs_context_operation structure
>>>     f2fs: switch to the new mount api
>>>
>>> 4. Cleanup the old unused structures and helpers.
>>>
>>>     f2fs: remove unused structure and functions
>>>
>>> There is still a potential to do some cleanups and perhaps
>>> refactoring. However that can be done later after the conversion
>>> to the new mount API which is the main purpose of the patchset.
>>>
>>> [1] https://lore.kernel.org/all/20211021114508.21407-1-lczerner@redhat.com/
>>>
>>> Hongbo Li (9):
>>>     f2fs: Add fs parameter specifications for mount options
>>>     f2fs: move the option parser into handle_mount_opt
>>>     f2fs: move option validation into a separate helper
>>>     f2fs: Allow sbi to be NULL in f2fs_printk
>>>     f2fs: Add f2fs_fs_context to record the mount options
>>>     f2fs: separate the options parsing and options checking
>>>     f2fs: introduce fs_context_operation structure
>>>     f2fs: switch to the new mount api
>>>     f2fs: remove unused structure and functions
>>>
>>>    fs/f2fs/super.c | 2211 ++++++++++++++++++++++++++++-------------------
>>>    1 file changed, 1341 insertions(+), 870 deletions(-)
>>>
>>
>
Hongbo Li Sept. 11, 2024, 2:04 a.m. UTC | #4
Is the subject of the email required to be [f2fs-dev][PATCH]?

Thanks,
Hongbo

On 2024/8/14 10:39, Hongbo Li wrote:
> Since many filesystems have done the new mount API conversion,
> we introduce the new mount API conversion in f2fs.
> 
> The series can be applied on top of the current mainline tree
> and the work is based on the patches from Lukas Czerner (has
> done this in ext4[1]). His patch give me a lot of ideas.
> 
> Here is a high level description of the patchset:
> 
> 1. Prepare the f2fs mount parameters required by the new mount
> API and use it for parsing, while still using the old API to
> get mount options string. Split the parameter parsing and
> validation of the parse_options helper into two separate
> helpers.
> 
>    f2fs: Add fs parameter specifications for mount options
>    f2fs: move the option parser into handle_mount_opt
>    f2fs: move option validation into a separate helper
> 
> 2. Remove the use of sb/sbi structure of f2fs from all the
> parsing code, because with the new mount API the parsing is
> going to be done before we even get the super block. In this
> part, we introduce f2fs_fs_context to hold the temporary
> options when parsing. For the simple options check, it has
> to be done during parsing by using f2fs_fs_context structure.
> For the check which needs sb/sbi, we do this during super
> block filling.
> 
>    f2fs: Allow sbi to be NULL in f2fs_printk
>    f2fs: Add f2fs_fs_context to record the mount options
>    f2fs: separate the options parsing and options checking
> 
> 3. Switch the f2fs to use the new mount API for mount and
> remount.
> 
>    f2fs: introduce fs_context_operation structure
>    f2fs: switch to the new mount api
> 
> 4. Cleanup the old unused structures and helpers.
> 
>    f2fs: remove unused structure and functions
> 
> There is still a potential to do some cleanups and perhaps
> refactoring. However that can be done later after the conversion
> to the new mount API which is the main purpose of the patchset.
> 
> [1] https://lore.kernel.org/all/20211021114508.21407-1-lczerner@redhat.com/
> 
> Hongbo Li (9):
>    f2fs: Add fs parameter specifications for mount options
>    f2fs: move the option parser into handle_mount_opt
>    f2fs: move option validation into a separate helper
>    f2fs: Allow sbi to be NULL in f2fs_printk
>    f2fs: Add f2fs_fs_context to record the mount options
>    f2fs: separate the options parsing and options checking
>    f2fs: introduce fs_context_operation structure
>    f2fs: switch to the new mount api
>    f2fs: remove unused structure and functions
> 
>   fs/f2fs/super.c | 2211 ++++++++++++++++++++++++++++-------------------
>   1 file changed, 1341 insertions(+), 870 deletions(-)
>
Chao Yu Sept. 12, 2024, 1:11 a.m. UTC | #5
On 2024/9/11 10:04, Hongbo Li wrote:
> Is the subject of the email required to be [f2fs-dev][PATCH]?

Hongbo,

"[f2fs-dev]" prefix is added by f2fs mailing list when it forwards
your patch to someone who subscribes the list, if you receive a patch
w/o f2fs-dev prefix, it is because you Sent/Cced patch to yourself,
and the list selected to not send you another email which has prefix
based on your mailing list option, IIUC.

So, it doesn't matter. :)

Thanks,
Hongbo Li Sept. 12, 2024, 1:49 a.m. UTC | #6
On 2024/9/12 9:11, Chao Yu wrote:
> On 2024/9/11 10:04, Hongbo Li wrote:
>> Is the subject of the email required to be [f2fs-dev][PATCH]?
> 
> Hongbo,
> 
> "[f2fs-dev]" prefix is added by f2fs mailing list when it forwards
> your patch to someone who subscribes the list, if you receive a patch
> w/o f2fs-dev prefix, it is because you Sent/Cced patch to yourself,
> and the list selected to not send you another email which has prefix
> based on your mailing list option, IIUC.

oh, I got it, thank you!

Thanks,
Hongbo
> 
> So, it doesn't matter. :)
> 
> Thanks,