blk-mq: put the driver tag of nxt rq before first one is requeued
authorJianchao Wang <jianchao.w.wang@oracle.com>
Thu, 2 Nov 2017 15:24:32 +0000 (23:24 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 4 Nov 2017 18:38:40 +0000 (12:38 -0600)
commit6d6f167ce74158903e7fc20dfbecf89c71aa1c00
tree33d6a3c6e22f9df0f2eca95b2bc21f9a72c3eda4
parente84010732225c4c7c3464ee1169d395751c3adfa
blk-mq: put the driver tag of nxt rq before first one is requeued

When freeing the driver tag of the next rq with an I/O scheduler
configured, we get the first entry of the list. However, this can
race with requeue of a request, and we end up getting the wrong request
from the head of the list. Free the driver tag of next rq before the
failed one is requeued in the failure branch of queue_rq callback.

Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c