All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Nilay Shroff <nilay@linux.ibm.com>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, axboe@fb.com,
	sagi@grimberg.me, gjoyce@linux.ibm.com, mkchauras@linux.ibm.com
Subject: Re: [PATCH] nvme-multipath: fix flex array size in struct nvme_ns_head
Date: Wed, 27 May 2026 07:49:05 -0600	[thread overview]
Message-ID: <ahb2UTQsJywNagyk@kbusch-mbp> (raw)
In-Reply-To: <20260527062010.4036702-1-nilay@linux.ibm.com>

On Wed, May 27, 2026 at 11:50:00AM +0530, Nilay Shroff wrote:
> Fix this by allocating the flexible array using nr_node_ids instead
> of num_possible_nodes(). Since nr_node_ids represents the maximum
> possible NUMA node IDs, indexing current_path[] using numa_node_id()
> becomes safe even on systems with sparse node IDs.

What is the largest nr_node_ids we can reasonably expect to see? I don't
want to end up trying to allocate a billion entry sparse array just to
index a tiny fraction of them. Not that we didn't have a similar problem
before, but this patch makes it clear we haven't been checking.


  parent reply	other threads:[~2026-05-27 13:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27  6:20 [PATCH] nvme-multipath: fix flex array size in struct nvme_ns_head Nilay Shroff
2026-05-27  6:40 ` Christoph Hellwig
2026-05-27  7:30 ` John Garry
2026-05-27  8:04 ` Mukesh Kumar Chaurasiya
2026-05-27 13:36 ` Hannes Reinecke
2026-05-27 13:49 ` Keith Busch [this message]
2026-05-27 15:06   ` Nilay Shroff
2026-05-27 15:15     ` Keith Busch

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=ahb2UTQsJywNagyk@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@fb.com \
    --cc=gjoyce@linux.ibm.com \
    --cc=hch@lst.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mkchauras@linux.ibm.com \
    --cc=nilay@linux.ibm.com \
    --cc=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.