]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: update hardware and software queues for sleeping alloc
authorJens Axboe <axboe@fb.com>
Thu, 27 Oct 2016 15:49:19 +0000 (09:49 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 28 Oct 2016 01:13:56 +0000 (19:13 -0600)
commitfc1e8f6c81b0e05f23cced3ad35f7a9220891389
tree47535b50e12507af176a503ebb364938c2fa3651
parent0a1518d19cfd1ed6c20f6b644003b467f4059605
blk-mq: update hardware and software queues for sleeping alloc

If we end up sleeping due to running out of requests, we should
update the hardware and software queues in the map ctx structure.
Otherwise we could end up having rq->mq_ctx point to the pre-sleep
context, and risk corrupting ctx->rq_list since we'll be
grabbing the wrong lock when inserting the request.

Reported-by: Dave Jones <davej@codemonkey.org.uk>
Reported-by: Chris Mason <clm@fb.com>
Tested-by: Chris Mason <clm@fb.com>
Fixes: e23ae8ed7d20 ("blk-mq: remove non-blocking pass in blk_mq_map_request")
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c