]> git.baikalelectronics.ru Git - kernel.git/commit
block: null_blk: fix queue leak inside removing device
authorMing Lei <tom.leiming@gmail.com>
Thu, 26 Dec 2013 13:31:37 +0000 (21:31 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 12 Jan 2014 09:22:42 +0000 (16:22 +0700)
commiteb650ae58f0f4423c6dd34a7ad2405af8d9e4b7c
tree841f92409aca75ab2eadea1955d96c33b107395a
parentf4b90b1e377abc40286cd045b0cff4c7cead284e
block: null_blk: fix queue leak inside removing device

When queue_mode is NULL_Q_MQ and null_blk is being removed,
blk_cleanup_queue() isn't called to cleanup queue, so the queue
allocated won't be freed.

This patch calls blk_cleanup_queue() for MQ to drain all pending
requests first and release the reference counter of queue kobject, then
blk_mq_free_queue() will be called in queue kobject's release handler
when queue kobject's reference counter drops to zero.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/null_blk.c