mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 01:32:46 +07:00
dm zoned: Fix metadata zone size check
When dm zoned has multiple devices, metadata is on the cache device, not
in random zones of the zoned devices. Then the number of metadata zones
shall be checked with the number of cache zones, not random zones.
Fixes: 34f5affd04
("dm zoned: separate random and cache zones")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
parent
e0034433a7
commit
b38c0ad57f
@ -1078,7 +1078,8 @@ static int dmz_check_sb(struct dmz_metadata *zmd, struct dmz_sb *dsb,
|
||||
nr_meta_zones = (le32_to_cpu(sb->nr_meta_blocks) + zmd->zone_nr_blocks - 1)
|
||||
>> zmd->zone_nr_blocks_shift;
|
||||
if (!nr_meta_zones ||
|
||||
nr_meta_zones >= zmd->nr_rnd_zones) {
|
||||
(zmd->nr_devs <= 1 && nr_meta_zones >= zmd->nr_rnd_zones) ||
|
||||
(zmd->nr_devs > 1 && nr_meta_zones >= zmd->nr_cache_zones)) {
|
||||
dmz_dev_err(dev, "Invalid number of metadata blocks");
|
||||
return -ENXIO;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user