Commit dc076c83 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Mike Snitzer

dm zoned: ignore metadata zone in dmz_alloc_zone()

When looking up zones in dmz_alloc_zone() we need to ignore
metadata zones so as not to accidentally overwrite metadata.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: default avatarBob Liu <bob.liu@oracle.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent ae3c1f11
...@@ -1907,7 +1907,13 @@ struct dm_zone *dmz_alloc_zone(struct dmz_metadata *zmd, unsigned long flags) ...@@ -1907,7 +1907,13 @@ struct dm_zone *dmz_alloc_zone(struct dmz_metadata *zmd, unsigned long flags)
zone = NULL; zone = NULL;
goto again; goto again;
} }
if (dmz_is_meta(zone)) {
struct dmz_dev *dev = dmz_zone_to_dev(zmd, zone);
dmz_dev_warn(dev, "Zone %u has metadata", zone->id);
zone = NULL;
goto again;
}
return zone; return zone;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment