* [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
@ 2022-07-11 9:08 Ming Lei
2022-07-11 10:10 ` Christoph Hellwig
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Ming Lei @ 2022-07-11 9:08 UTC (permalink / raw)
To: Jens Axboe; +Cc: Christoph Hellwig, linux-block, Ming Lei, Yi Zhang
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.
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
block/blk-mq-debugfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index b80fae7ab1d9..28adb01f6441 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-11 9:08 [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created Ming Lei
@ 2022-07-11 10:10 ` Christoph Hellwig
2022-07-11 10:44 ` Yi Zhang
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2022-07-11 10:10 UTC (permalink / raw)
To: Ming Lei; +Cc: Jens Axboe, Christoph Hellwig, linux-block, Yi Zhang
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-11 9:08 [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created Ming Lei
2022-07-11 10:10 ` Christoph Hellwig
@ 2022-07-11 10:44 ` Yi Zhang
2022-07-11 13:57 ` Jens Axboe
2022-07-11 17:20 ` Bart Van Assche
3 siblings, 0 replies; 8+ messages in thread
From: Yi Zhang @ 2022-07-11 10:44 UTC (permalink / raw)
To: Ming Lei; +Cc: Jens Axboe, Christoph Hellwig, linux-block
Verified on linux-block/for-next,
Tested-by: Yi Zhang <yi.zhang@redhat.com>
On Mon, Jul 11, 2022 at 5:08 PM Ming Lei <ming.lei@redhat.com> wrote:
>
> 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.
>
> Reported-by: Yi Zhang <yi.zhang@redhat.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
> block/blk-mq-debugfs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index b80fae7ab1d9..28adb01f6441 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -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
>
--
Best Regards,
Yi Zhang
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-11 9:08 [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created Ming Lei
2022-07-11 10:10 ` Christoph Hellwig
2022-07-11 10:44 ` Yi Zhang
@ 2022-07-11 13:57 ` Jens Axboe
2022-07-11 17:20 ` Bart Van Assche
3 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2022-07-11 13:57 UTC (permalink / raw)
To: ming.lei; +Cc: yi.zhang, Christoph Hellwig, linux-block
On Mon, 11 Jul 2022 17:08:08 +0800, Ming Lei wrote:
> 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.
>
>
> [...]
Applied, thanks!
[1/1] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
commit: 52b0e38ae7985386d5b5e4653cc20fc2c6c95ce9
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-11 9:08 [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created Ming Lei
` (2 preceding siblings ...)
2022-07-11 13:57 ` Jens Axboe
@ 2022-07-11 17:20 ` Bart Van Assche
2022-07-12 1:50 ` Ming Lei
3 siblings, 1 reply; 8+ messages in thread
From: Bart Van Assche @ 2022-07-11 17:20 UTC (permalink / raw)
To: Ming Lei, Jens Axboe; +Cc: Christoph Hellwig, linux-block, Yi Zhang
On 7/11/22 02:08, Ming Lei wrote:
> 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.
>
> Reported-by: Yi Zhang <yi.zhang@redhat.com>
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
> block/blk-mq-debugfs.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index b80fae7ab1d9..28adb01f6441 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-11 17:20 ` Bart Van Assche
@ 2022-07-12 1:50 ` Ming Lei
2022-07-12 19:52 ` Bart Van Assche
0 siblings, 1 reply; 8+ messages in thread
From: Ming Lei @ 2022-07-12 1:50 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Jens Axboe, Christoph Hellwig, linux-block, Yi Zhang
On Mon, Jul 11, 2022 at 10:20:39AM -0700, Bart Van Assche wrote:
> On 7/11/22 02:08, Ming Lei wrote:
> > 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.
> >
> > Reported-by: Yi Zhang <yi.zhang@redhat.com>
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
> > ---
> > block/blk-mq-debugfs.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> > index b80fae7ab1d9..28adb01f6441 100644
> > --- a/block/blk-mq-debugfs.c
> > +++ b/block/blk-mq-debugfs.c
> > @@ -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,
Fixes: 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions")
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-12 1:50 ` Ming Lei
@ 2022-07-12 19:52 ` Bart Van Assche
2022-07-12 20:00 ` Jens Axboe
0 siblings, 1 reply; 8+ messages in thread
From: Bart Van Assche @ 2022-07-12 19:52 UTC (permalink / raw)
To: Ming Lei; +Cc: Jens Axboe, Christoph Hellwig, linux-block, Yi Zhang
On 7/11/22 18:50, Ming Lei wrote:
> On Mon, Jul 11, 2022 at 10:20:39AM -0700, Bart Van Assche wrote:
>> Does this patch need a Fixes: tag?
>
> Yeah,
>
> Fixes: 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions")
>
>>
>> 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.
Hi Ming,
Since this patch is already in Jens' tree I will let Jens decide how to proceed.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
2022-07-12 19:52 ` Bart Van Assche
@ 2022-07-12 20:00 ` Jens Axboe
0 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2022-07-12 20:00 UTC (permalink / raw)
To: Bart Van Assche, Ming Lei; +Cc: Christoph Hellwig, linux-block, Yi Zhang
On 7/12/22 1:52 PM, Bart Van Assche wrote:
> On 7/11/22 18:50, Ming Lei wrote:
>> On Mon, Jul 11, 2022 at 10:20:39AM -0700, Bart Van Assche wrote:
>>> Does this patch need a Fixes: tag?
>>
>> Yeah,
>>
>> Fixes: 6cfc0081b046 ("blk-mq: no need to check return value of debugfs_create functions")
>>
>>>
>>> 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.
>
> 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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-07-12 20:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-11 9:08 [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created Ming Lei
2022-07-11 10:10 ` Christoph Hellwig
2022-07-11 10:44 ` Yi Zhang
2022-07-11 13:57 ` Jens Axboe
2022-07-11 17:20 ` Bart Van Assche
2022-07-12 1:50 ` Ming Lei
2022-07-12 19:52 ` Bart Van Assche
2022-07-12 20:00 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).