Skip to content

Commit 7fb4898

Browse files
Keith Buschaxboe
authored andcommitted
block: add blk-mq support to blk_insert_cloned_request()
If the request passed to blk_insert_cloned_request() was allocated by a blk-mq device it must be submitted using blk_mq_insert_request(). Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent febf715 commit 7fb4898

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

block/blk-core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,13 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq)
20482048
should_fail_request(&rq->rq_disk->part0, blk_rq_bytes(rq)))
20492049
return -EIO;
20502050

2051+
if (q->mq_ops) {
2052+
if (blk_queue_io_stat(q))
2053+
blk_account_io_start(rq, true);
2054+
blk_mq_insert_request(rq, false, true, true);
2055+
return 0;
2056+
}
2057+
20512058
spin_lock_irqsave(q->queue_lock, flags);
20522059
if (unlikely(blk_queue_dying(q))) {
20532060
spin_unlock_irqrestore(q->queue_lock, flags);

0 commit comments

Comments
 (0)