diff options
author | Josef Bacik <josef@toxicpanda.com> | 2017-03-28 23:37:52 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-03-29 22:18:18 +0300 |
commit | b58e176914c4786fd28edfc44e7174310613fc31 (patch) | |
tree | 845c56600c0fe27279c2bfe172bd2a3a5e4611e5 /block/blk-mq.c | |
parent | 457e490f2b7417564b681992e4eee355e1dcbb14 (diff) | |
download | linux-b58e176914c4786fd28edfc44e7174310613fc31.tar.xz |
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.c | 3 |
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); } |