fsck.f2fs: check BLKZONED feature on mount
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 28 Oct 2016 07:57:04 +0000 (16:57 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 2 Nov 2016 00:27:35 +0000 (17:27 -0700)
The BLKZONED feature is mandatory for host-managed zoned block
devices. So check that it is set.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c

index b70ffe7..dd7a081 100644 (file)
@@ -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;