summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-05-26 11:45:02 +0200
committerJens Axboe <axboe@fb.com>2014-05-26 17:21:51 -0600
commit19c5d84f14d2b01fe4c24e1444142f69e6dc08f6 (patch)
treef69523d38d3d2c7dc9942291f2e06a72577b8c8a /block
parentc22d9d8a60646a1521ae12a2176f58da19afa186 (diff)
downloadlinux-19c5d84f14d2b01fe4c24e1444142f69e6dc08f6.tar.gz
linux-19c5d84f14d2b01fe4c24e1444142f69e6dc08f6.tar.bz2
linux-19c5d84f14d2b01fe4c24e1444142f69e6dc08f6.zip
blk-mq: idle all hardware contexts before freeing a queue
Without this we can leak the active_queues reference if a command is freed while it is considered active. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 9bc075335d06..62082c5daae7 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1844,6 +1844,7 @@ void blk_mq_free_queue(struct request_queue *q)
blk_mq_del_queue_tag_set(q);
queue_for_each_hw_ctx(q, hctx, i) {
+ blk_mq_tag_idle(hctx);
kfree(hctx->ctxs);
blk_mq_unregister_cpu_notifier(&hctx->cpu_notifier);
if (q->mq_ops->exit_hctx)