]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: lpfc: Handle duplicate D_IDs in ndlp search-by D_ID routine
authorJustin Tee <justin.tee@broadcom.com>
Fri, 31 Jan 2025 00:05:22 +0000 (16:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:16 +0000 (14:40 +0200)
commit14f8b37e1ce769fda57c826ca04ec090d57a04d8
tree1d5e30a99e032c328e088d7bd16204a55af58631
parent31fbeed785db8ae984f672d2779fa8c0c5b0e7c5
scsi: lpfc: Handle duplicate D_IDs in ndlp search-by D_ID routine

[ Upstream commit 56c3d809b7b450379162d0b8a70bbe71ab8db706 ]

After a port swap between separate fabrics, there may be multiple nodes in
the vport's fc_nodes list with the same fabric well known address.
Duplication is temporary and eventually resolves itself after dev_loss_tmo
expires, but nameserver queries may still occur before dev_loss_tmo.  This
possibly results in returning stale fabric ndlp objects.  Fix by adding an
nlp_state check to ensure the ndlp search routine returns the correct newer
allocated ndlp fabric object.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20250131000524.163662-5-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_hbadisc.c