Commit b58e1769 authored by Josef Bacik's avatar Josef Bacik Committed by Jens Axboe

block-mq: don't re-queue if we get a queue error

When try to issue a request directly and we fail we will requeue the
request, but call blk_mq_end_request() as well.  This leads to the
completed request being on a queuelist and getting ended twice, which
causes list corruption in schedulers and other shenanigans.
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Reviewed-by: default avatarMing Lei <tom.leiming@gmail.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 457e490f
......@@ -1475,8 +1475,6 @@ static void __blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
return;
}
__blk_mq_requeue_request(rq);
if (ret == BLK_MQ_RQ_QUEUE_ERROR) {
*cookie = BLK_QC_T_NONE;
rq->errors = -EIO;
......@@ -1484,6 +1482,7 @@ static void __blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
return;
}
__blk_mq_requeue_request(rq);
insert:
blk_mq_sched_insert_request(rq, false, true, false, may_sleep);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment