f2fs: judge whether discard_unit is section only when have CONFIG_BLK_DEV_ZONED
authorYangtao Li <frank.li@vivo.com>
Tue, 29 Nov 2022 12:29:28 +0000 (20:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:56 +0000 (09:42 +0200)
commit33d4c00725b0deefdd1d25261a414456da708251
tree2bb1cb4ce585d939e7ea771826dfd626a35bdf6c
parent4d7e804f49a0b19ec4d5dd8ec6465088091be851
f2fs: judge whether discard_unit is section only when have CONFIG_BLK_DEV_ZONED

[ Upstream commit b5a711acab305e04278c136c841ba37c589c16a1 ]

The current logic, regardless of whether CONFIG_BLK_DEV_ZONED
is enabled or not, will judge whether discard_unit is SECTION,
when f2fs_sb_has_blkzoned.

In fact, when CONFIG_BLK_DEV_ZONED is not enabled, this judgment
is a path that will never be accessed. At this time, -EINVAL will
be returned in the parse_options function, accompanied by the
message "Zoned block device support is not enabled".

Let's wrap this discard_unit judgment with CONFIG_BLK_DEV_ZONED.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Stable-dep-of: 2bd4df8fcbc7 ("f2fs: Only lfs mode is allowed with zoned block device feature")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/super.c