[dm-devel] [PATCH 10/11] dm-zoned: ignore metadata zone in dmz_alloc_zone()

Damien Le Moal Damien.LeMoal at wdc.com
Tue Apr 7 02:56:35 UTC 2020


On 2020/04/07 2:29, Hannes Reinecke wrote:
> When looking up zones in dmz_alloc_zone() we need to ignore
> metadata zones so as not to accidentally overwrite metadata.
> 
> Signed-off-by: Hannes Reinecke <hare at suse.de>

Reviewed-by: Damien Le Moal <damien.lemoal at wdc.com>

> ---
>  drivers/md/dm-zoned-metadata.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c
> index 6c52cbf290d5..e036ba4bfe57 100644
> --- a/drivers/md/dm-zoned-metadata.c
> +++ b/drivers/md/dm-zoned-metadata.c
> @@ -1910,7 +1910,13 @@ struct dm_zone *dmz_alloc_zone(struct dmz_metadata *zmd, unsigned long flags)
>  		zone = NULL;
>  		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", dmz_id(zmd, zone));
> +		zone = NULL;
> +		goto again;
> +	}
>  	return zone;
>  }
>  
> 


-- 
Damien Le Moal
Western Digital Research






More information about the dm-devel mailing list