Re: [PATCH v3 03/14] block: Fix zone write plug initialization from blk_revalidate_zone_cb()

Hannes Reinecke
2024-05-02T05:53:36Z

On 5/1/24 13:08, Damien Le Moal wrote:
> When revalidating the zones of a zoned block device,
> blk_revalidate_zone_cb() must allocate a zone write plug for any
> sequential write required zone that is not empty nor full. However, the
> current code tests the latter case by comparing the zone write pointer
> offset to the zone size instead of the zone capacity. Furthermore,
> disk_get_and_lock_zone_wplug() is called with a sector argument equal to
> the zone start instead of the current zone write pointer position.
> This commit fixes both issues by calling disk_get_and_lock_zone_wplug()
> for a zone that is not empty and with a write pointer offset lower than
> the zone capacity and use the zone capacity sector as the sector
> argument for disk_get_and_lock_zone_wplug().
>
> Fixes: dd291d77cc90 ("block: Introduce zone write plugging")
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
> block/blk-zoned.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich