]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: lpfc: Correct used_rpi count when devloss tmo fires with no recovery
authorJustin Tee <justin.tee@broadcom.com>
Wed, 1 Mar 2023 23:16:22 +0000 (15:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:37 +0000 (17:32 +0100)
commit8348301fb8abb4ca064e4dfacde7531d2cef48ac
tree4bf78273359ea6a8874bca6918b13d994a6f78ad
parent4e0e613307aa84974e630f60e5d045f4b234093b
scsi: lpfc: Correct used_rpi count when devloss tmo fires with no recovery

[ Upstream commit db651ec22524eb8f9c854fbb4d9acd5d7e5be9e4 ]

A fabric controller can sometimes send an RDP request right before a link
down event.  Because of this outstanding RDP request, the driver does not
remove the last reference count on its ndlp causing a potential leak of RPI
resources when devloss tmo fires.

In lpfc_cmpl_els_rsp(), modify the NPIV clause to always allow the
lpfc_drop_node() routine to execute when not registered with SCSI
transport.

This relaxes the contraint that an NPIV ndlp must be in a specific state in
order to call lpfc_drop node.  Logic is revised such that the
lpfc_drop_node() routine is always called to ensure the last ndlp decrement
occurs.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20230301231626.9621-7-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_els.c