[PATCH] nvme-multipath: fix flex array size in struct nvme_ns_head

Keith Busch kbusch at kernel.org
Wed May 27 08:15:53 PDT 2026


On Wed, May 27, 2026 at 08:36:43PM +0530, Nilay Shroff wrote:
> Looking across the architectures supported by Linux, CONFIG_NODES_SHIFT
> appears to be capped at 10, which gives:
> 
> MAX_NUMNODES = 1 << 10 = 1024
> 
> So in practice, nr_node_ids should not exceed 1024.
> 
> This means the flexible array allocation remains bounded and should not grow
> into an unreasonably large sparse allocation.

Cool, thanks for checking. Will get this applied to nvme-7.2.



More information about the Linux-nvme mailing list