diff options
| author | Damien Le Moal <damien.lemoal@wdc.com> | 2016-10-28 17:45:01 +0900 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-12-01 10:47:36 -0800 |
| commit | 5b0f4f4c6a017a563edb90f393dd01d0f4dc7d4c (patch) | |
| tree | f3b2cceb7e9aed67eeb177d46adce30f601275c2 /fs | |
| parent | 6e89bc832cc20e2edd05167dec11ca2a60b6d5d2 (diff) | |
f2fs: Check zoned block feature for host-managed zoned block devices
The F2FS_FEATURE_BLKZONED feature indicates that the drive was formatted
with zone alignment optimization. This is optional for host-aware
devices, but mandatory for host-managed zoned block devices.
So check that the feature is set in this latter case.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/f2fs/super.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 3574d0620dc4..4187e3b9a83e 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1639,6 +1639,26 @@ try_onemore: sb->s_fs_info = sbi; sbi->raw_super = raw_super; + /* + * The BLKZONED feature indicates that the drive was formatted with + * zone alignment optimization. This is optional for host-aware + * devices, but mandatory for host-managed zoned block devices. + */ +#ifndef CONFIG_BLK_DEV_ZONED + if (f2fs_sb_mounted_blkzoned(sb)) { + f2fs_msg(sb, KERN_ERR, + "Zoned block device support is not enabled\n"); + goto free_sb_buf; + } +#else + if (bdev_zoned_model(sb->s_bdev) == BLK_ZONED_HM && + !f2fs_sb_mounted_blkzoned(sb)) { + f2fs_msg(sb, KERN_ERR, + "Zoned block device feature not enabled\n"); + goto free_sb_buf; + } +#endif + default_options(sbi); /* parse mount options */ options = kstrdup((const char *)data, GFP_KERNEL); |
