From: Josef Bacik Date: Tue, 28 Mar 2017 20:37:52 +0000 (-0400) Subject: block-mq: don't re-queue if we get a queue error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b58e176914c4786fd28edfc44e7174310613fc31;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Josef Bacik Reviewed-by: Ming Lei Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index f79775fc6d1b..5a4a2361053e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -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); }