Commit 70e62f4b authored by Omar Sandoval's avatar Omar Sandoval Committed by Jens Axboe

blk-mq-debugfs: fix device sched directory for default scheduler

In blk_mq_debugfs_register(), I remembered to set up the per-hctx sched
directories if a default scheduler was already configured by
blk_mq_sched_init() from blk_mq_init_allocated_queue(), but I didn't do
the same for the device-wide sched directory. Fix it.

Fixes: d332ce09 ("blk-mq-debugfs: allow schedulers to register debugfs attributes")
Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6cd1a6fe
...@@ -815,10 +815,14 @@ int blk_mq_debugfs_register(struct request_queue *q) ...@@ -815,10 +815,14 @@ int blk_mq_debugfs_register(struct request_queue *q)
goto err; goto err;
/* /*
* blk_mq_init_hctx() attempted to do this already, but q->debugfs_dir * blk_mq_init_sched() attempted to do this already, but q->debugfs_dir
* didn't exist yet (because we don't know what to name the directory * didn't exist yet (because we don't know what to name the directory
* until the queue is registered to a gendisk). * until the queue is registered to a gendisk).
*/ */
if (q->elevator && !q->sched_debugfs_dir)
blk_mq_debugfs_register_sched(q);
/* Similarly, blk_mq_init_hctx() couldn't do this previously. */
queue_for_each_hw_ctx(q, hctx, i) { queue_for_each_hw_ctx(q, hctx, i) {
if (!hctx->debugfs_dir && blk_mq_debugfs_register_hctx(q, hctx)) if (!hctx->debugfs_dir && blk_mq_debugfs_register_hctx(q, hctx))
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment