Skip to content

Commit 70e62f4

Browse files
osandovaxboe
authored andcommitted
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: d332ce0 ("blk-mq-debugfs: allow schedulers to register debugfs attributes") Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6cd1a6f commit 70e62f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

block/blk-mq-debugfs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,10 +815,14 @@ int blk_mq_debugfs_register(struct request_queue *q)
815815
goto err;
816816

817817
/*
818-
* blk_mq_init_hctx() attempted to do this already, but q->debugfs_dir
818+
* blk_mq_init_sched() attempted to do this already, but q->debugfs_dir
819819
* didn't exist yet (because we don't know what to name the directory
820820
* until the queue is registered to a gendisk).
821821
*/
822+
if (q->elevator && !q->sched_debugfs_dir)
823+
blk_mq_debugfs_register_sched(q);
824+
825+
/* Similarly, blk_mq_init_hctx() couldn't do this previously. */
822826
queue_for_each_hw_ctx(q, hctx, i) {
823827
if (!hctx->debugfs_dir && blk_mq_debugfs_register_hctx(q, hctx))
824828
goto err;

0 commit comments

Comments
 (0)