Message ID | 20221007193234.3958465-1-kbusch@meta.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: fix leaking minors of hidden disks | expand |
On Fri, Oct 07, 2022 at 12:32:34PM -0700, Keith Busch wrote: > + if (disk->major == BLOCK_EXT_MAJOR) > + blk_free_ext_minor(disk->first_minor); > iput(disk->part0->bd_inode); /* frees the disk */ > } Oops, the above is missing the check for the hidden flag. V2 coming.
diff --git a/block/genhd.c b/block/genhd.c index 514395361d7c..d46edf26320a 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1166,6 +1166,8 @@ static void disk_release(struct device *dev) if (test_bit(GD_ADDED, &disk->state) && disk->fops->free_disk) disk->fops->free_disk(disk); + if (disk->major == BLOCK_EXT_MAJOR) + blk_free_ext_minor(disk->first_minor); iput(disk->part0->bd_inode); /* frees the disk */ }