aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Bacik <[email protected]>2017-03-28 16:37:52 -0400
committerJens Axboe <[email protected]>2017-03-29 13:18:18 -0600
commitb58e176914c4786fd28edfc44e7174310613fc31 (patch)
tree845c56600c0fe27279c2bfe172bd2a3a5e4611e5
parent457e490f2b7417564b681992e4eee355e1dcbb14 (diff)
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 <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
-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);
}