blk-mq: Fix queue usage on failed request allocation
authorKeith Busch <keith.busch@intel.com>
Mon, 14 Aug 2017 20:40:11 +0000 (16:40 -0400)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Aug 2017 13:22:34 +0000 (07:22 -0600)
commit3280d66a6363af0df0441709bc0bc302bd9a2510
tree3287661883d9a26da45c9c2b6a524c75e4cc0eda
parentef954844c7ace62f773f4f23e28d2d915adc419f
blk-mq: Fix queue usage on failed request allocation

blk_mq_get_request() does not release the callers queue usage counter
when allocation fails. The caller still needs to account for its own
queue usage when it is unable to allocate a request.

Fixes: 1ad43c0078b7 ("blk-mq: don't leak preempt counter/q_usage_counter when allocating rq failed")

Reported-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c