mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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: 6691d940b0 ("f2fs: introduce fragment allocation mode mount option")
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -862,11 +862,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
|
|||||||
if (!name)
|
if (!name)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
if (!strcmp(name, "adaptive")) {
|
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;
|
F2FS_OPTION(sbi).fs_mode = FS_MODE_ADAPTIVE;
|
||||||
} else if (!strcmp(name, "lfs")) {
|
} else if (!strcmp(name, "lfs")) {
|
||||||
F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
|
F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS;
|
||||||
@@ -1331,6 +1326,11 @@ default_check:
|
|||||||
F2FS_OPTION(sbi).discard_unit =
|
F2FS_OPTION(sbi).discard_unit =
|
||||||
DISCARD_UNIT_SECTION;
|
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
|
#else
|
||||||
f2fs_err(sbi, "Zoned block device support is not enabled");
|
f2fs_err(sbi, "Zoned block device support is not enabled");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|||||||
Reference in New Issue
Block a user