* [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature
@ 2023-06-20 14:10 Chunhai Guo via Linux-f2fs-devel
2023-07-19 11:44 ` Chunhai Guo via Linux-f2fs-devel
2023-08-02 14:52 ` Chao Yu
0 siblings, 2 replies; 4+ messages in thread
From: Chunhai Guo via Linux-f2fs-devel @ 2023-06-20 14:10 UTC (permalink / raw)
To: chao, jaegeuk; +Cc: Chunhai Guo, linux-f2fs-devel
Now f2fs support four block allocation modes: lfs, adaptive,
fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
device feature.
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
---
fs/f2fs/super.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index c917fa771f0e..6249483be905 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -861,12 +861,14 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
if (!name)
return -ENOMEM;
+
+ if (strcmp(name, "lfs") && f2fs_sb_has_blkzoned(sbi)) {
+ f2fs_warn(sbi, "Only lfs mode is allowed with zoned block device feature");
+ kfree(name);
+ return -EINVAL;
+ }
+
if (!strcmp(name, "adaptive")) {
- if (f2fs_sb_has_blkzoned(sbi)) {
- f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
- kfree(name);
- return -EINVAL;
- }
F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
} else if (!strcmp(name, "lfs")) {
F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature
2023-06-20 14:10 [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature Chunhai Guo via Linux-f2fs-devel
@ 2023-07-19 11:44 ` Chunhai Guo via Linux-f2fs-devel
2023-08-02 14:52 ` Chao Yu
1 sibling, 0 replies; 4+ messages in thread
From: Chunhai Guo via Linux-f2fs-devel @ 2023-07-19 11:44 UTC (permalink / raw)
To: chao@kernel.org, jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Hi Chao & Jaegeuk,
Could you please help to review this patch?
Thanks.
On 2023/6/20 22:10, 郭纯海 wrote:
> Now f2fs support four block allocation modes: lfs, adaptive,
> fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
> device feature.
>
> Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
> ---
> fs/f2fs/super.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index c917fa771f0e..6249483be905 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -861,12 +861,14 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
>
> if (!name)
> return -ENOMEM;
> +
> + if (strcmp(name, "lfs") && f2fs_sb_has_blkzoned(sbi)) {
> + f2fs_warn(sbi, "Only lfs mode is allowed with zoned block device feature");
> + kfree(name);
> + return -EINVAL;
> + }
> +
> if (!strcmp(name, "adaptive")) {
> - if (f2fs_sb_has_blkzoned(sbi)) {
> - f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
> - kfree(name);
> - return -EINVAL;
> - }
> F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
> } else if (!strcmp(name, "lfs")) {
> F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature
2023-06-20 14:10 [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature Chunhai Guo via Linux-f2fs-devel
2023-07-19 11:44 ` Chunhai Guo via Linux-f2fs-devel
@ 2023-08-02 14:52 ` Chao Yu
2023-08-03 14:32 ` Chunhai Guo via Linux-f2fs-devel
1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2023-08-02 14:52 UTC (permalink / raw)
To: Chunhai Guo, jaegeuk; +Cc: linux-f2fs-devel
On 2023/6/20 22:10, Chunhai Guo wrote:
> Now f2fs support four block allocation modes: lfs, adaptive,
> fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
> device feature.
>
> Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
> ---
> fs/f2fs/super.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index c917fa771f0e..6249483be905 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -861,12 +861,14 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
>
> if (!name)
> return -ENOMEM;
> +
> + if (strcmp(name, "lfs") && f2fs_sb_has_blkzoned(sbi)) {
> + f2fs_warn(sbi, "Only lfs mode is allowed with zoned block device feature");
> + kfree(name);
> + return -EINVAL;
> + }
What about:
From f6e71f1d33c2cca543ebb41734c7a95af5190767 Mon Sep 17 00:00:00 2001
From: Chunhai Guo <guochunhai@vivo.com>
Date: Sun, 30 Jul 2023 10:06:50 +0800
Subject: [PATCH] f2fs: only lfs mode is allowed with zoned block device
feature
Now f2fs support four block allocation modes: lfs, adaptive,
fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
device feature.
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
---
fs/f2fs/super.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 099e126c61e1..1d0593358125 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -864,11 +864,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
if (!name)
return -ENOMEM;
if (!strcmp(name, "adaptive")) {
- if (f2fs_sb_has_blkzoned(sbi)) {
- f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
- kfree(name);
- return -EINVAL;
- }
F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
} else if (!strcmp(name, "lfs")) {
F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
@@ -1333,6 +1328,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
F2FS_OPTION(sbi).discard_unit =
DISCARD_UNIT_SECTION;
}
+ if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS) {
+ f2fs_info(sbi, "Only lfs mode is allowed with zoned block device feature");
+ return -EINVAL;
+ }
#else
f2fs_err(sbi, "Zoned block device support is not enabled");
return -EINVAL;
--
2.40.1
> +
> if (!strcmp(name, "adaptive")) {
> - if (f2fs_sb_has_blkzoned(sbi)) {
> - f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
> - kfree(name);
> - return -EINVAL;
> - }
> F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
> } else if (!strcmp(name, "lfs")) {
> F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature
2023-08-02 14:52 ` Chao Yu
@ 2023-08-03 14:32 ` Chunhai Guo via Linux-f2fs-devel
0 siblings, 0 replies; 4+ messages in thread
From: Chunhai Guo via Linux-f2fs-devel @ 2023-08-03 14:32 UTC (permalink / raw)
To: Chao Yu, jaegeuk@kernel.org; +Cc: linux-f2fs-devel@lists.sourceforge.net
Hi Chao,
I have sent the second patch with your suggestion. Please have a check.
Thanks.
On 2023/8/2 22:52, Chao Yu wrote:
> On 2023/6/20 22:10, Chunhai Guo wrote:
>> Now f2fs support four block allocation modes: lfs, adaptive,
>> fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
>> device feature.
>>
>> Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
>> ---
>> fs/f2fs/super.c | 12 +++++++-----
>> 1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
>> index c917fa771f0e..6249483be905 100644
>> --- a/fs/f2fs/super.c
>> +++ b/fs/f2fs/super.c
>> @@ -861,12 +861,14 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
>>
>> if (!name)
>> return -ENOMEM;
>> +
>> + if (strcmp(name, "lfs") && f2fs_sb_has_blkzoned(sbi)) {
>> + f2fs_warn(sbi, "Only lfs mode is allowed with zoned block device feature");
>> + kfree(name);
>> + return -EINVAL;
>> + }
>
> What about:
>
> From f6e71f1d33c2cca543ebb41734c7a95af5190767 Mon Sep 17 00:00:00 2001
> From: Chunhai Guo <guochunhai@vivo.com>
> Date: Sun, 30 Jul 2023 10:06:50 +0800
> Subject: [PATCH] f2fs: only lfs mode is allowed with zoned block device
> feature
>
> Now f2fs support four block allocation modes: lfs, adaptive,
> fragment:segment, fragment:block. Only lfs mode is allowed with zoned block
> device feature.
>
> Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
> ---
> fs/f2fs/super.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 099e126c61e1..1d0593358125 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -864,11 +864,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
> if (!name)
> return -ENOMEM;
> if (!strcmp(name, "adaptive")) {
> - if (f2fs_sb_has_blkzoned(sbi)) {
> - f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
> - kfree(name);
> - return -EINVAL;
> - }
> F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
> } else if (!strcmp(name, "lfs")) {
> F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
> @@ -1333,6 +1328,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
> F2FS_OPTION(sbi).discard_unit =
> DISCARD_UNIT_SECTION;
> }
> + if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS) {
> + f2fs_info(sbi, "Only lfs mode is allowed with zoned block device feature");
> + return -EINVAL;
> + }
> #else
> f2fs_err(sbi, "Zoned block device support is not enabled");
> return -EINVAL;
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-03 14:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20 14:10 [f2fs-dev] [PATCH] f2fs: Only lfs mode is allowed with zoned block device feature Chunhai Guo via Linux-f2fs-devel
2023-07-19 11:44 ` Chunhai Guo via Linux-f2fs-devel
2023-08-02 14:52 ` Chao Yu
2023-08-03 14:32 ` Chunhai Guo via Linux-f2fs-devel
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).