If we're driving multiple devices, we could have pre-populated the cache for a different device. Ensure that the empty request matches the current queue. Fixes: 47c122e35d7e ("block: pre-allocate requests if plug is started and is a batch") Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 875bd0c04409..6c8d02bd1b06 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2529,7 +2529,7 @@ static inline struct request *blk_mq_get_request(struct request_queue *q, struct request *rq; rq = rq_list_peek(&plug->cached_rq); - if (rq) { + if (rq && rq->q == q) { if (unlikely(!submit_bio_checks(bio))) return NULL; plug->cached_rq = rq_list_next(rq); -- 2.33.1