blk-mq: fix up placement of debugfs directory of queue files
Subsystems (2)
Greg Kroah-Hartman
maintainerPATCH 1/1 blk-mq: fix up placement of debugfs directory of queue files
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.
--- block/blk-mq-debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+)
block/blk-mq-debugfs.c +7 -0
@@ -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 ;
Signature · 1 line
2.22.0
Jens Axboe
maintainerQuoted 6 lines · Greg Kroah-Hartman
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.
How about we shove this in for 5.2 final? Trivial enough to do, and it would suck to have 5.2 released with this. Though not sure what devices this actually impacts, I haven't noticed anything awry on my setups?
Signature · 1 line
Jens Axboe
Greg Kroah-Hartman
maintainerQuoted 10 lines · Jens Axboe
Quoted 6 lines · Greg Kroah-Hartman
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.
How about we shove this in for 5.2 final? Trivial enough to do, and it would suck to have 5.2 released with this.
Sure, no objection from me!
Quoted 2 lines
Though not sure what devices this actually impacts, I haven't noticed anything awry on my setups?
I can easily trigger this with loop devices. I know Stephen reported this and I don't know if that was the driver that caused it for him. I have also seen this happen in syzbot boot logs already, but again, don't know what block devices they are using that causes this.
thanks,
greg k-h