]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: don't leak preempt counter/q_usage_counter when allocating rq failed
authorMing Lei <minlei@redhat.com>
Wed, 2 Aug 2017 00:01:45 +0000 (08:01 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Aug 2017 14:23:57 +0000 (08:23 -0600)
commita7ced61f68d2e86bb31757ab88fa5cc5f1f64333
tree480939827df51b046781e8d2f16def36f6412e0c
parent1cf84ecb07253650f31cd89b943497a4eaceeeae
blk-mq: don't leak preempt counter/q_usage_counter when allocating rq failed

When blk_mq_get_request() failed, preempt counter isn't
released, and blk_mq_make_request() doesn't release the counter
too.

This patch fixes the issue, and makes sure that preempt counter
is only held if rq is allocated successfully. The same policy is
applied on .q_usage_counter too.

Signed-off-by: Ming Lei <minlei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c