public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	Dan Williams <dan.j.williams@intel.com>,
	yukuai <yukuai3@huawei.com>
Subject: Re: [PATCH V2 2/2] block: fix "Directory XXXXX with parent 'block' already present!"
Date: Sun, 24 Apr 2022 17:24:12 +0800	[thread overview]
Message-ID: <YmUXPA4EE5jOo1yz@T590> (raw)
In-Reply-To: <20220423162937.GA28340@lst.de>

On Sat, Apr 23, 2022 at 06:29:37PM +0200, Christoph Hellwig wrote:
> On Sat, Apr 23, 2022 at 10:39:52PM +0800, Ming Lei wrote:
> > q->debugfs_dir is used by blk-mq debugfs and blktrace. The dentry is
> > created when adding disk, and removed when releasing request queue.
> > 
> > There is small window between releasing disk and releasing request
> > queue, and during the period, one disk with same name may be created
> > and added, so debugfs_create_dir() may complain with "Directory XXXXX
> > with parent 'block' already present!"
> > 
> > Fixes the issue by moving debugfs_create_dir() into blk_alloc_queue(),
> > and the dir name is named with q->id from beginning, and switched to
> > disk name when adding disk, and finally changed to q->id in disk_release().
> 
> As said before I very much think this is going in the wrong direction.

So far I'd suggest to keep q->debugfs_dir inside request queue, another
goodness is that we can use it for exposing non-blk qeueue's debug info,
and there is request queue without gendisk attached.

> 
> As the debugfs directory use the name of the gendisk, the lifetime rules
> should simply match those of the gendisk.  If anyone wants to trace
> SCSI commands sent before probing the gendisk or after removing it
> they can use blktrace on the /dev/sg node.

Not sure blktrace can trace on /dev/sg since blktrace works on
block_device.


Thanks, 
Ming


  reply	other threads:[~2022-04-24  9:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 14:39 [PATCH V2 0/2] block: fix "Directory XXXXX with parent 'block' already present!" Ming Lei
2022-04-23 14:39 ` [PATCH V2 1/2] debugfs: fix declaration of debugfs_rename Ming Lei
2022-04-23 14:39 ` [PATCH V2 2/2] block: fix "Directory XXXXX with parent 'block' already present!" Ming Lei
2022-04-23 16:29   ` Christoph Hellwig
2022-04-24  9:24     ` Ming Lei [this message]
2022-04-25  7:49       ` Christoph Hellwig
2022-04-25  9:18         ` Ming Lei
2022-04-24  8:53   ` Hannes Reinecke
2022-04-24  9:28     ` Ming Lei
2022-04-24 11:51       ` Hannes Reinecke
2022-04-24 12:04         ` Ming Lei
2022-04-24 13:45           ` Greg Kroah-Hartman
2022-04-25  1:28             ` Ming Lei
2022-04-25  5:10               ` Greg Kroah-Hartman
2022-04-25  7:48                 ` Christoph Hellwig
2022-04-25  7:53                   ` Hannes Reinecke
2022-04-25  9:07                 ` Ming Lei
2022-04-25  9:32                   ` Hannes Reinecke
2022-04-26  3:07                     ` Ming Lei
2022-05-23 13:11   ` Yu Kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmUXPA4EE5jOo1yz@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox