[PATCH 1/3] scsi: mpt3sas: check set_identify result in update_links

From: Shirong Zhao

Date: Fri Oct 09 2026 - 06:25:39 EST


mpt3sas_transport_update_links() ignores the return value of
_transport_set_identify(), which leaves the identify struct untouched
on FW query failure (host/PCI recovery, config page error, bad IOC
status). The phy is then attached using a stale
remote_identify.sas_address from before the failed query.

Fold the call into the if condition so a failed query takes the
existing zeroing else path (same "no valid identify" state as an
invalid handle/rate) instead of attaching with stale data. The next
successful link event re-fills the identify.

Verified against scsi.git fixes (469fa055664b), the current SCSI
fixes tree.

Signed-off-by: Shirong Zhao <shxzhaosr@xxxxxxx>
---
drivers/scsi/mpt3sas/mpt3sas_transport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index e74a526ef..ffd1d37d2 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -1179,9 +1179,9 @@ mpt3sas_transport_update_links(struct MPT3SAS_ADAPTER *ioc,
mpt3sas_phy = &sas_node->phy[phy_number];
mpt3sas_phy->attached_handle = handle;
spin_unlock_irqrestore(&ioc->sas_node_lock, flags);
- if (handle && (link_rate >= MPI2_SAS_NEG_LINK_RATE_1_5)) {
- _transport_set_identify(ioc, handle,
- &mpt3sas_phy->remote_identify);
+ if (handle && link_rate >= MPI2_SAS_NEG_LINK_RATE_1_5 &&
+ !_transport_set_identify(ioc, handle,
+ &mpt3sas_phy->remote_identify)) {
if ((sas_node->handle <= ioc->sas_hba.num_phys) &&
(ioc->multipath_on_hba)) {
list_for_each_entry(hba_port,