blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
PATCH 1/1 blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
blk_mq_debugfs_register_hctx() can be called by blk_mq_update_nr_hw_queues when gendisk isn't added yet, such as nvme tcp.
Fixes the warning of 'debugfs: Directory 'hctx0' with parent '/' already present!' which can be observed reliably when running blktests nvme/005.
--- block/blk-mq-debugfs.c | 3 +++ 1 file changed, 3 insertions(+)
block/blk-mq-debugfs.c +3 -0
@@ -728,6 +728,9 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q,char name[20 ];int i; +if (!q->debugfs_dir) +return ; +snprintf (name,sizeof (name),"hctx%u" , hctx->queue_num); hctx->debugfs_dir =debugfs_create_dir (name, q->debugfs_dir);
Signature · 1 line
2.31.1
Looks good:
Verified on linux-block/for-next,
Quoted 30 lines · Ming Lei
blk_mq_debugfs_register_hctx()can be called byblk_mq_update_nr_hw_queueswhen gendisk isn't added yet, such as nvme tcp.Fixes the warning of 'debugfs: Directory 'hctx0' with parent '/' already present!' which can be observed reliably when running blktests nvme/005.
Reported-by Yi Zhang <[email protected]>Signed-off-by Ming Lei <[email protected]>--- block/blk-mq-debugfs.c | 3 +++ 1 file changed, 3 insertions(+)block/blk-mq-debugfs.c +3
-1@@ -728,6 +728,9 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q,char name[20 ];int i; +if (!q->debugfs_dir) +return ; +snprintf (name,sizeof (name),"hctx%u" , hctx->queue_num); hctx->debugfs_dir =debugfs_create_dir (name, q->debugfs_dir); --2.31.1
Signature · 2 lines
Best Regards, Yi Zhang
Quoted 8 lines · Ming Lei
blk_mq_debugfs_register_hctx()can be called byblk_mq_update_nr_hw_queueswhen gendisk isn't added yet, such as nvme tcp.Fixes the warning of 'debugfs: Directory 'hctx0' with parent '/' already present!' which can be observed reliably when running blktests nvme/005.
[...]
Applied, thanks!
[1/1] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
commit: 52b0e38ae7985386d5b5e4653cc20fc2c6c95ce9
Best regards,
Signature · 1 line
Jens Axboe
Quoted 17 lines · Ming Lei
blk_mq_debugfs_register_hctx()can be called byblk_mq_update_nr_hw_queueswhen gendisk isn't added yet, such as nvme tcp.Fixes the warning of 'debugfs: Directory 'hctx0' with parent '/' already present!' which can be observed reliably when running blktests nvme/005.
Reported-by Yi Zhang <[email protected]>Signed-off-by Ming Lei <[email protected]>--- block/blk-mq-debugfs.c | 3 +++ 1 file changed, 3 insertions(+)block/blk-mq-debugfs.c +0
-0
block/blk-mq-debugfs.c void blk_mq_debugfs_register_hctx(struct request_queue *q, · line 736
Quoted 9 lines
block/blk-mq-debugfs.c +3
-0@@ -728,6 +728,9 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q,char name[20 ];int i; +if (!q->debugfs_dir) +return ; +snprintf (name,sizeof (name),"hctx%u" , hctx->queue_num); hctx->debugfs_dir =debugfs_create_dir (name, q->debugfs_dir);
Does this patch need a Fixes: tag?
Additionally, as one can see here, I reported this bug before Yi: https://bugzilla.kernel.org/show_bug.cgi?id=216191
Thanks,
Bart.
Quoted 13 lines · Bart Van Assche
Quoted 12 lines · Ming Lei
blk_mq_debugfs_register_hctx()can be called byblk_mq_update_nr_hw_queueswhen gendisk isn't added yet, such as nvme tcp.Fixes the warning of 'debugfs: Directory 'hctx0' with parent '/' already present!' which can be observed reliably when running blktests nvme/005.
Reported-by Yi Zhang <[email protected]>Signed-off-by Ming Lei <[email protected]>--- block/blk-mq-debugfs.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 14 lines
block/blk-mq-debugfs.c void blk_mq_debugfs_register_hctx(struct request_queue *q, · line 734
Quoted 12 lines
block/blk-mq-debugfs.c +3
-0@@ -728,6 +728,9 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q,char name[20 ];int i; +if (!q->debugfs_dir) +return ; +snprintf (name,sizeof (name),"hctx%u" , hctx->queue_num); hctx->debugfs_dir =debugfs_create_dir (name, q->debugfs_dir);Does this patch need a Fixes: tag?
Yeah,
Quoted 3 lines
Additionally, as one can see here, I reported this bug before Yi:
https://bugzilla.kernel.org/show_bug.cgi?id=216191
Sorry for missing your report, and I am fine to add your reported-by.
Thanks,
Ming
Quoted 5 lines · Ming Lei
Quoted 1 line · Bart Van Assche
Does this patch need a Fixes: tag?
Yeah,
Quoted 7 lines
Fixes 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions")Quoted 3 lines
Additionally, as one can see here, I reported this bug before Yi:
https://bugzilla.kernel.org/show_bug.cgi?id=216191Sorry for missing your report, and I am fine to add your reported-by.
Hi Ming,
Since this patch is already in Jens' tree I will let Jens decide how to proceed.
Thanks,
Bart.
Jens Axboe
maintainerQuoted 12 lines · Bart Van Assche
Quoted 11 lines · Ming Lei
Quoted 1 line · Bart Van Assche
Does this patch need a Fixes: tag?
Yeah,
Fixes 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions")Quoted 3 lines
Additionally, as one can see here, I reported this bug before Yi:
https://bugzilla.kernel.org/show_bug.cgi?id=216191
Quoted 6 lines
Quoted 1 line
Sorry for missing your report, and I am fine to add your reported-by.
Hi Ming,
Since this patch is already in Jens' tree I will let Jens decide how to proceed.
It was top of that branch, I did amend it this morning with the Fixes tag. I missed the reported-by, however... Sorry.
Signature · 1 line
Jens Axboe