summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-05-19 06:40:48 +0200
committerJens Axboe <axboe@kernel.dk>2023-05-20 03:52:29 +0200
commit615939a2ae734e3e68c816d6749d1f5f79c62ab7 (patch)
tree9071830638e153f97f940d75d45c7d85862bf14e /block
parentblk-mq: use the I/O scheduler for writes from the flush state machine (diff)
downloadlinux-615939a2ae734e3e68c816d6749d1f5f79c62ab7.tar.xz
linux-615939a2ae734e3e68c816d6749d1f5f79c62ab7.zip
blk-mq: defer to the normal submission path for post-flush requests
Requests with the FUA bit on hardware without FUA support need a post flush before returning to the caller, but they can still be sent using the normal I/O path after initializing the flush-related fields and end I/O handler. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230519044050.107790-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-flush.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 6fb9cf2d3818..7121f9ad0762 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -432,6 +432,17 @@ bool blk_insert_flush(struct request *rq)
* Queue for normal execution.
*/
return false;
+ case REQ_FSEQ_DATA | REQ_FSEQ_POSTFLUSH:
+ /*
+ * Initialize the flush fields and completion handler to trigger
+ * the post flush, and then just pass the command on.
+ */
+ blk_rq_init_flush(rq);
+ rq->flush.seq |= REQ_FSEQ_POSTFLUSH;
+ spin_lock_irq(&fq->mq_flush_lock);
+ list_move_tail(&rq->flush.list, &fq->flush_data_in_flight);
+ spin_unlock_irq(&fq->mq_flush_lock);
+ return false;
default:
/*
* Mark the request as part of a flush sequence and submit it