From: Christoph Hellwig <hch@infradead.org>
To: Keith Busch <kbusch@meta.com>
Cc: linux-block@vger.kernel.org, axboe@kernel.dk,
Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
Daniel Wagner <dwagner@suse.de>
Subject: Re: [PATCHv2] block: fix leaking minors of hidden disks
Date: Mon, 10 Oct 2022 00:36:26 -0700 [thread overview]
Message-ID: <Y0PLerK6pBp9UC2G@infradead.org> (raw)
In-Reply-To: <20221007193825.4058951-1-kbusch@meta.com>
On Fri, Oct 07, 2022 at 12:38:25PM -0700, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> The major/minor of a hidden gendisk is not propagated to the block
> device. This is required to suppress it from being visible. For these
> disks, we need to handle freeing the dynamic minor directly when it's
> released since bdev_free_inode() won't be able to.
This now leads to a different lifetime. I think the proper fix is
the one below (untested):
diff --git a/block/genhd.c b/block/genhd.c
index d36fabf0abc1f..1752ce356484e 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -507,6 +507,8 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
*/
dev_set_uevent_suppress(ddev, 0);
disk_uevent(disk, KOBJ_ADD);
+ } else {
+ disk->part0->bd_dev = ddev->devt;
}
disk_update_readahead(disk);
next prev parent reply other threads:[~2022-10-10 7:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 19:38 [PATCHv2] block: fix leaking minors of hidden disks Keith Busch
2022-10-10 6:43 ` Daniel Wagner
2022-10-10 6:51 ` Chaitanya Kulkarni
2022-10-10 7:36 ` Christoph Hellwig [this message]
2022-10-10 8:02 ` Daniel Wagner
2022-10-10 8:19 ` Christoph Hellwig
2022-10-10 8:49 ` Daniel Wagner
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=Y0PLerK6pBp9UC2G@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-block@vger.kernel.org \
/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