Re: [PATCH v3 09/14] block: Fix handling of non-empty flush write requests to zones

Hannes Reinecke
2024-05-02T06:12:02Z

On 5/1/24 13:09, Damien Le Moal wrote:
> Zone write plugging ignores empty (no data) flush operations but handles
> flush BIOs that have data to ensure that the flush machinery generated
> write is processed in order. However, the call to
> blk_zone_write_plug_attempt_merge() which sets a request
> RQF_ZONE_WRITE_PLUGGING flag is called after blk_insert_flush(), thus
> missing indicating that a non empty flush request completion needs
> handling by zone write plugging.
>
> Fix this by moving the call to blk_zone_write_plug_attempt_merge()
> before blk_insert_flush(). And while at it, rename that function as
> blk_zone_write_plug_init_request() to be clear that it is not just about
> merging plugged BIOs in the request. While at it, also add a WARN_ONCE()
> check that the zone write plug for the request is not NULL.
>
> 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-mq.c | 6 +++---
> block/blk-zoned.c | 12 ++++++++----
> block/blk.h | 4 ++--
> 3 files changed, 13 insertions(+), 9 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