mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
[ Upstream commitf3ec5d1155
] 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. Fixes:6cfc0081b0
("blk-mq: no need to check return value of debugfs_create functions") Reported-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Tested-by: Yi Zhang <yi.zhang@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220711090808.259682-1-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1c350a597c
commit
6d8e185bf9
1 changed files with 3 additions and 0 deletions
|
@ -879,6 +879,9 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q,
|
||||||
char name[20];
|
char name[20];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!q->debugfs_dir)
|
||||||
|
return;
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "hctx%u", hctx->queue_num);
|
snprintf(name, sizeof(name), "hctx%u", hctx->queue_num);
|
||||||
hctx->debugfs_dir = debugfs_create_dir(name, q->debugfs_dir);
|
hctx->debugfs_dir = debugfs_create_dir(name, q->debugfs_dir);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue