mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: "vulab@iscas.ac.cn" <vulab@iscas.ac.cn>
Cc: "sathya.prakash@broadcom.com" <sathya.prakash@broadcom.com>,
	"sreekanth.reddy@broadcom.com" <sreekanth.reddy@broadcom.com>,
	"suganath-prabu.subramani@broadcom.com"
	<suganath-prabu.subramani@broadcom.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"MPT-FusionLinux.pdl@broadcom.com"
	<MPT-FusionLinux.pdl@broadcom.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 回复: [PATCH] scsi: mpt3sas: Fix invalid NUMA node index
Date: Fri, 2 Jan 2026 10:33:26 +0000	[thread overview]
Message-ID: <49d4b21c-cb2c-455b-8ab3-014bac63deaa@oracle.com> (raw)
In-Reply-To: <SE5P216MB338083B78B7FFF35811F70A3FCBCA@SE5P216MB3380.KORP216.PROD.OUTLOOK.COM>

On 31/12/2025 01:19, vulab@iscas.ac.cn wrote:
> Hi John,
> 
> Thank you for the feedback.
> 
> Regarding the suggestion to audit all cpumask_of_node() implementations:
> 
> I noticed that a very similar issue was recently fixed in the
> megaraid_sas driver (commit 752eb816b55a, "scsi: megaraid_sas: Fix
> invalid node index"), where an UBSAN array-index-out-of-bounds warning
> was addressed by handling NUMA_NO_NODE locally in the driver.
> 
> Following that approach, it seems reasonable for mpt3sas to handle
> this case locally as well, while leaving any broader unification of
> cpumask_of_node() semantics across architectures as a separate
> discussion, since changes in the x86 topology headers may have wider
> impact.
> 
> Regarding the fallback behavior:
> 
> The existing megaraid_sas fix falls back to node 0, but as you pointed
> out, some implementations (e.g. drivers/base/arch_numa.c) treat
> NUMA_NO_NODE as indicating no specific NUMA locality and return
> cpu_all_mask. Forcing node 0 in this case may unnecessarily constrain
> interrupt affinity on NUMA systems.
> 
> For a v2, I propose to:
> 
> 
>    1.
> Fix the issue locally in the mpt3sas driver (similar to
> 
> megaraid_sas); and
> 
> 
>    1.
> Use cpu_online_mask as the fallback when dev_to_node() returns
> 
> NUMA_NO_NODE, to  better match the intended semantics, while still
> preventing out-of-bounds access.
> 
> Please let me know if this sounds acceptable.

I am not the driver maintainer, so it is not my choice.

But I will try to remedy this in the per-arch code if you don't want to.

  parent reply	other threads:[~2026-01-02 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30  3:14 Haotian Zhang
2025-12-30  7:45 ` John Garry
     [not found]   ` <SE5P216MB338083B78B7FFF35811F70A3FCBCA@SE5P216MB3380.KORP216.PROD.OUTLOOK.COM>
2026-01-02 10:33     ` John Garry [this message]
2026-01-26  8:33     ` 回复: " John Garry

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=49d4b21c-cb2c-455b-8ab3-014bac63deaa@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    --cc=vulab@iscas.ac.cn \
    /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

all inboxes | Powered by JetHome®