Skip to content

Commit a59e0f5

Browse files
Keith Buschaxboe
authored andcommitted
blk-mq: End unstarted requests on dying queue
Go directly to ending a request if it wasn't started. Previously, completing a request may invoke a driver callback for a request it didn't initialize. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 5f009d3 commit a59e0f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

block/blk-mq.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,10 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx,
599599
* If a request wasn't started before the queue was
600600
* marked dying, kill it here or it'll go unnoticed.
601601
*/
602-
if (unlikely(blk_queue_dying(rq->q)))
603-
blk_mq_complete_request(rq, -EIO);
602+
if (unlikely(blk_queue_dying(rq->q))) {
603+
rq->errors = -EIO;
604+
blk_mq_end_request(rq, rq->errors);
605+
}
604606
return;
605607
}
606608

0 commit comments

Comments
 (0)