]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: free hctx->ctxs in queue's release handler
authorMing Lei <tom.leiming@gmail.com>
Thu, 4 Jun 2015 14:25:04 +0000 (22:25 +0800)
committerJens Axboe <axboe@fb.com>
Tue, 9 Jun 2015 21:32:38 +0000 (15:32 -0600)
commitc0d43c5c20cdd3903cb18126e66ab33db83c41bd
tree2bf7586a979548fb0fc950e5b84b646f96360ea6
parentbe9a3ee1b35a8f842500792cdbc9a1f4ff512b29
blk-mq: free hctx->ctxs in queue's release handler

Now blk_cleanup_queue() can be called before calling
del_gendisk()[1], inside which hctx->ctxs is touched
from blk_mq_unregister_hctx(), but the variable has
been freed by blk_cleanup_queue() at that time.

So this patch moves freeing of hctx->ctxs into queue's
release handler for fixing the oops reported by Stefan.

[1], 5273269310b2d1d (block: destroy bdi before blockdev is
unregistered)

Reported-by: Stefan Seyfried <stefan.seyfried@googlemail.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org (v4.0)
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c