Skip to content

Commit

Permalink
blk-mq: fix up placement of debugfs directory of queue files
Browse files Browse the repository at this point in the history
When the blk-mq debugfs file creation logic was "cleaned up" it was
cleaned up too much, causing the queue file to not be created in the
correct location.  Turns out the check for the directory being present
is needed as if that has not happened yet, the files should not be
created, and the function will be called later on in the initialization
code so that the files can be created in the correct location.

Fixes: 6cfc008 ("blk-mq: no need to check return value of debugfs_create functions")
Reported-by: Stephen Rothwell <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
gregkh authored and axboe committed Jul 6, 2019
1 parent e6feaf2 commit 7e41c3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions block/blk-mq-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,13 @@ void blk_mq_debugfs_register_sched(struct request_queue *q)
{
struct elevator_type *e = q->elevator->type;

/*
* If the parent directory has not been created yet, return, we will be
* called again later on and the directory/files will be created then.
*/
if (!q->debugfs_dir)
return;

if (!e->queue_debugfs_attrs)
return;

Expand Down

0 comments on commit 7e41c3c

Please sign in to comment.