Re: [PATCH v3 05/14] block: Hold a reference on zone write plugs to schedule submission

Hannes Reinecke
2024-05-02T06:04:45Z

On 5/1/24 13:08, Damien Le Moal wrote:
> Since a zone write plug BIO work is a field of struct blk_zone_wplug, we
> must ensure that a zone write plug is never freed when its BIO
> submission work is queued or running. Do this by holding a reference on
> the zone write plug when the submission work is scheduled for execution
> with queue_work() and releasing the reference at the end of the
> execution of the work function blk_zone_wplug_bio_work().
> The helper function disk_zone_wplug_schedule_bio_work() is introduced to
> get a reference on a zone write plug and queue its work. This helper is
> used in disk_zone_wplug_unplug_bio() and disk_zone_wplug_handle_error().
>
> 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 | 26 +++++++++++++++++++++-----
> 1 file changed, 21 insertions(+), 5 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