blk-mq: move debugfs_remove() of disk dir to blk_release_queue()
authorOmar Sandoval <osandov@fb.com>
Tue, 31 Jan 2017 22:53:21 +0000 (14:53 -0800)
committerJens Axboe <axboe@fb.com>
Thu, 2 Feb 2017 17:20:16 +0000 (10:20 -0700)
This needs to happen after we tear down blktrace.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-sysfs.c
block/blk-sysfs.c

index 308b3f4fc3104a373927b916b2afd224832c1833..295e69670c39343d058cbf7f67fc076f7249e94e 100644 (file)
@@ -254,7 +254,7 @@ static void __blk_mq_unregister_dev(struct device *dev, struct request_queue *q)
                kobject_put(&hctx->kobj);
        }
 
-       blk_mq_debugfs_unregister(q);
+       blk_mq_debugfs_unregister_hctxs(q);
 
        kobject_uevent(&q->mq_kobj, KOBJ_REMOVE);
        kobject_del(&q->mq_kobj);
index 3e204789b8d3e0b98b113ff83da22d04ca6aad73..3ce1217778f4493f5c6ab4a9e90c42f4c60b71f7 100644 (file)
@@ -824,6 +824,9 @@ static void blk_release_queue(struct kobject *kobj)
 
        blk_trace_shutdown(q);
 
+       if (q->mq_ops)
+               blk_mq_debugfs_unregister(q);
+
        if (q->bio_split)
                bioset_free(q->bio_split);