summaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
authorDamien Le Moal <dlemoal@kernel.org>2024-05-01 20:09:02 +0900
committerJens Axboe <axboe@kernel.dk>2024-05-01 08:08:43 -0600
commit096bc7ea335bc5dfbaed1d005ff27f008ec9d710 (patch)
tree8393c99e90fdac1e4c5102704ce956b46c0235c9 /block/blk.h
parentaf147b740f111730c2e387ee6c0ac3ada7d51117 (diff)
downloadlinux-096bc7ea335bc5dfbaed1d005ff27f008ec9d710.tar.gz
linux-096bc7ea335bc5dfbaed1d005ff27f008ec9d710.tar.bz2
linux-096bc7ea335bc5dfbaed1d005ff27f008ec9d710.zip
block: Fix handling of non-empty flush write requests to zones
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> Link: https://lore.kernel.org/r/20240501110907.96950-10-dlemoal@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk.h b/block/blk.h
index 1140c4a0be03..8a62b861453c 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -427,7 +427,7 @@ static inline bool bio_is_zone_append(struct bio *bio)
bio_flagged(bio, BIO_EMULATES_ZONE_APPEND);
}
void blk_zone_write_plug_bio_merged(struct bio *bio);
-void blk_zone_write_plug_attempt_merge(struct request *rq);
+void blk_zone_write_plug_init_request(struct request *rq);
static inline void blk_zone_update_request_bio(struct request *rq,
struct bio *bio)
{
@@ -481,7 +481,7 @@ static inline bool bio_is_zone_append(struct bio *bio)
static inline void blk_zone_write_plug_bio_merged(struct bio *bio)
{
}
-static inline void blk_zone_write_plug_attempt_merge(struct request *rq)
+static inline void blk_zone_write_plug_init_request(struct request *rq)
{
}
static inline void blk_zone_update_request_bio(struct request *rq,