Skip to contentSkip to conversation

f2fs: Only lfs mode is allowed with zoned block device feature

PATCH Applied Chunhai Guo via Linux-f2fs-devel 3 participants 3 messages Aug 3, 2023 – Aug 14, 2023 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
 fs/f2fs/super.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
fs/f2fs/super.c +5 -5
index 30883beb750a..26add77f9062 100644
@@ -862,11 +862,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;
@@ -1331,6 +1326,11 @@ 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;
Signature · 8 lines
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
maintainer
#1 lore raw
Quoted 4 lines · Chunhai Guo

Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature.

Fixes 6691d940b0e0 ("f2fs: introduce fragment allocation mode mount option")

Otherwise, it looks good to me.

Thanks,

Quoted 23 lines
---
  fs/f2fs/super.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
fs/f2fs/super.c +0 -5
index 30883beb750a..26add77f9062 100644
@@ -862,11 +862,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;
@@ -1331,6 +1326,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
  			F2FS_OPTION(sbi).discard_unit =

fs/f2fs/super.c static int parse_options(struct super_block *sb, char *options, bool is_remount) · line 1336

Quoted 10 lines
fs/f2fs/super.c +5 -0
  					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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
In reply to Chunhai Guo via Linux-f2fs-devel
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 8 lines · On Thu, 3 Aug 2023 22:28:42 +0800 you wrote:

Now f2fs support four block allocation modes: lfs, adaptive, fragment:segment, fragment:block. Only lfs mode is allowed with zoned block device feature.

---
 fs/f2fs/super.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Here is the summary with links:
- [f2fs-dev,v2] f2fs: Only lfs mode is allowed with zoned block device feature

    https://git.kernel.org/jaegeuk/f2fs/c/2bd4df8fcbc7

You are awesome, thank you!

Signature · 10 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel