Skip to content

Commit 2bd4df8

Browse files
Chunhai GuoJaegeuk Kim
authored andcommitted
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. Fixes: 6691d94 ("f2fs: introduce fragment allocation mode mount option") Signed-off-by: Chunhai Guo <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 3cb88bc commit 2bd4df8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/f2fs/super.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,11 +862,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
862862
if (!name)
863863
return -ENOMEM;
864864
if (!strcmp(name, "adaptive")) {
865-
if (f2fs_sb_has_blkzoned(sbi)) {
866-
f2fs_warn(sbi, "adaptive mode is not allowed with zoned block device feature");
867-
kfree(name);
868-
return -EINVAL;
869-
}
870865
F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
871866
} else if (!strcmp(name, "lfs")) {
872867
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)
13311326
F2FS_OPTION(sbi).discard_unit =
13321327
DISCARD_UNIT_SECTION;
13331328
}
1329+
1330+
if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS) {
1331+
f2fs_info(sbi, "Only lfs mode is allowed with zoned block device feature");
1332+
return -EINVAL;
1333+
}
13341334
#else
13351335
f2fs_err(sbi, "Zoned block device support is not enabled");
13361336
return -EINVAL;

0 commit comments

Comments
 (0)