]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
block: blk_add_rq_to_plug(): clear stale 'last' after flush
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 1 Nov 2022 00:54:13 +0000 (00:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Nov 2022 08:27:19 +0000 (09:27 +0100)
[ Upstream commit 878eb6e48f240d02ed1c9298020a0b6370695f24 ]

blk_mq_flush_plug_list() empties ->mq_list and request we'd peeked there
before that call is gone; in any case, we are not dealing with a mix
of requests for different queues now - there's no requests left in the
plug.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
block/blk-mq.c

index edf41959a705fc047f2c3871a11158d99ecbd28f..4402e4ecb8b11438a6a8003b24631c4565fb0833 100644 (file)
@@ -1183,6 +1183,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
                   (!blk_queue_nomerges(rq->q) &&
                    blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) {
                blk_mq_flush_plug_list(plug, false);
+               last = NULL;
                trace_block_plug(rq->q);
        }