[PATCH v4 06/28] block: Remember zone capacity when revalidating zones
Hannes Reinecke
hare at suse.de
Tue Apr 2 11:04:57 PDT 2024
On 4/2/24 14:38, Damien Le Moal wrote:
> In preparation for adding zone write plugging, modify
> blk_revalidate_disk_zones() to get the capacity of zones of a zoned
> block device. This capacity value as a number of 512B sectors is stored
> in the gendisk zone_capacity field.
>
> Given that host-managed SMR disks (including zoned UFS drives) and all
> known NVMe ZNS devices have the same zone capacity for all zones
> blk_revalidate_disk_zones() returns an error if different capacities are
> detected for different zones.
>
> This also adds check to verify that the values reported by the device
> for zone capacities are correct, that is, that the zone capacity is
> never 0, does not exceed the zone size and is equal to the zone size for
> conventional zones.
>
> Signed-off-by: Damien Le Moal <dlemoal at kernel.org>
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> ---
> block/blk-zoned.c | 26 ++++++++++++++++++++++++++
> include/linux/blkdev.h | 1 +
> 2 files changed, 27 insertions(+)
>
Reviewed-by: Hannes Reinecke <hare at suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Ivo Totev, Andrew McDonald,
Werner Knoblich
More information about the Linux-nvme
mailing list