Re: [PATCH RFC v2 1/2] block: scan partitions for hidden disks
John Garry <[email protected]>
| Newsgroups | org.infradead.lists.linux-nvme,org.kernel.vger.linux-block |
|---|---|
| Message-ID | <[email protected]> |
On 8/19/26 10:13, Christoph Hellwig wrote: > On Wed, Aug 19, 2026 at 10:12:50AM +0100, John Garry wrote: >>> It also is used for giving a handle to NVMe devices that we can't support >>> as block devices and for which we only want a handle to issue passthrough >>> commands. For those attempting a partition scan is rather suboptimal. >> >> We could set GENHD_FL_NO_PART in that case (as well as the hidden flag). > > I guess we could do that. It still feels wrong, though : Maybe we just don't change the GENHD_FL_HIDDEN behavior. As long as /proc/diskstats and /proc/partitions don't show those per-path partitions. It seems to me that we need to have a dedicated function to clone the partitions, and it would be called per NS after nvme_mpath_set_live() -> device_add_disk(). I am not sure if that works, though. We may get nvme_ns_head_submit_bio() looking up the per-path partition before they are available. In that case I would need to keep the path disabled until after the partition table is available. > >>> As is in general doing an extra scan per controller when we know it must >>> give the same results. Wouldn't it make more sense to just propagate >>> the partition table from the ns_head to each individual path? >> >> So you mean that we would have something which can clone the head gendisk >> partitions onto the per-path gendisk by itering >part_tbl and calling >> something like blk_add_partition(), right? > > Yes. ok