Re: [PATCH] blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Verified on linux-block/for-next,
Tested-by: Yi Zhang <yi.zhang@xxxxxxxxxx>

On Mon, Jul 11, 2022 at 5:08 PM Ming Lei <ming.lei@xxxxxxxxxx> 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@xxxxxxxxxx>
> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
> ---
>  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




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux