From 4b1ecd77a182c731c29cd31986508fdbe53829ed Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Fri, 28 Oct 2016 16:57:04 +0900 Subject: [PATCH] fsck.f2fs: check BLKZONED feature on mount The BLKZONED feature is mandatory for host-managed zoned block devices. So check that it is set. Signed-off-by: Damien Le Moal Signed-off-by: Jaegeuk Kim --- fsck/mount.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fsck/mount.c b/fsck/mount.c index b70ffe7..dd7a081 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -399,6 +399,13 @@ int sanity_check_raw_super(struct f2fs_super_block *sb, u64 offset) get_sb(root_ino) != 3) return -1; + /* Check zoned block device feature */ + if (c.zoned_model == F2FS_ZONED_HM && + !(sb->feature & cpu_to_le32(F2FS_FEATURE_BLKZONED))) { + MSG(0, "\tMissing zoned block device feature\n"); + return -1; + } + if (sanity_check_area_boundary(sb, offset)) return -1; return 0; -- 2.7.4