block: blk_add_rq_to_plug(): clear stale 'last' after flush block-6.1-2022-11-05
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 1 Nov 2022 00:54:13 +0000 (00:54 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Nov 2022 02:21:38 +0000 (20:21 -0600)
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>
block/blk-mq.c

index 21cc7c2da0f965f2df1a56ceee6ee6a5cd85041e..6a789cda68a5b408aec38b20a5467c13336d0dc8 100644 (file)
@@ -1262,6 +1262,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);
        }