summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2017-03-28 22:37:52 +0200
committerJens Axboe <axboe@fb.com>2017-03-29 21:18:18 +0200
commitb58e176914c4786fd28edfc44e7174310613fc31 (patch)
tree845c56600c0fe27279c2bfe172bd2a3a5e4611e5 /block/blk-mq.c
parentblkcg: allocate struct blkcg_gq outside request queue spinlock (diff)
downloadlinux-b58e176914c4786fd28edfc44e7174310613fc31.tar.xz
linux-b58e176914c4786fd28edfc44e7174310613fc31.zip
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 <jbacik@fb.com> Reviewed-by: Ming Lei <tom.leiming@gmail.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c3
1 files changed, 1 insertions, 2 deletions
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);
}