linux/drivers/scsi/lpfc
James Smart 07aaefdf75 scsi: lpfc: Fix crash when a fabric node is released prematurely
The driver's management of the fabric controller (aka pseudo-scsi
initiator) node in SLI3 mode is causing this crash. The crash occurs
because of a node reference imbalance that frees the fabric controller node
while devloss is outstanding from the SCSI transport.  This is triggered by
an odd behavior where the switch reacts to a rejected RDP request with a
PLOGI and nothing else, not even a LOGO.  The driver ACKS the PLOGI and
after successfully registering the RPI, incorrectly registers the fabric
controller node because it has the NLP_FC4_FCP flag still set from the
fabric controller PRLI.  If a LIP is issued, the driver attempts to cleanup
on Link Up and ends up executing too many puts.

Fix by detecting the fabric node type and clearing out the nodes internal
flags that triggered a SCSI transport registration and subsequence dev_loss
event.  The driver cannot count on any persistence from fabric controller
nodes.

Link: https://lore.kernel.org/r/20210104180240.46824-5-jsmart2021@gmail.com
Co-developed-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-07 23:02:35 -05:00
..
lpfc_attr.c scsi: lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3 2021-01-07 23:02:35 -05:00
lpfc_attr.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_bsg.c scsi: lpfc: Fix fall-through warnings for Clang 2020-12-02 12:59:47 -05:00
lpfc_bsg.h scsi: lpfc: Allow applications to issue Common Set Features mailbox command 2020-07-02 23:06:40 -04:00
lpfc_compat.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_crtn.h scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_ct.c scsi: lpfc: Fix missing prototype warning for lpfc_fdmi_vendor_attr_mi() 2020-11-19 22:19:41 -05:00
lpfc_debugfs.c scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_debugfs.h scsi: lpfc: Make debugfs ktime stats generic for NVME and SCSI 2020-03-29 18:10:58 -04:00
lpfc_disc.h scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_els.c scsi: lpfc: Fix PLOGI S_ID of 0 on pt2pt config 2021-01-07 23:02:35 -05:00
lpfc_hbadisc.c scsi: lpfc: Fix crash when a fabric node is released prematurely 2021-01-07 23:02:35 -05:00
lpfc_hw4.h scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_hw.h scsi: lpfc: Reject CT request for MIB commands 2020-10-26 21:42:39 -04:00
lpfc_ids.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_init.c scsi: lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3 2021-01-07 23:02:35 -05:00
lpfc_logmsg.h scsi: lpfc: Add an internal trace log buffer 2020-07-02 23:06:49 -04:00
lpfc_mbox.c scsi: lpfc: Fix a bunch of kerneldoc misdemeanors 2020-07-24 22:32:03 -04:00
lpfc_mem.c scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free() 2020-10-26 21:42:38 -04:00
lpfc_nl.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc_nportdisc.c scsi: lpfc: Fix crash when a fabric node is released prematurely 2021-01-07 23:02:35 -05:00
lpfc_nvme.c scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_nvme.h scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_nvmet.c scsi: lpfc: Fix missing prototype for lpfc_nvmet_prep_abort_wqe() 2020-11-19 22:21:50 -05:00
lpfc_scsi.c scsi: lpfc: Fix pointer defereference before it is null checked issue 2020-11-19 22:13:42 -05:00
lpfc_scsi.h scsi: lpfc: Update 12.2.0.0 file copyrights to 2019 2019-02-05 22:29:50 -05:00
lpfc_sli4.h scsi: lpfc: Add FDMI Vendor MIB support 2020-10-26 21:42:39 -04:00
lpfc_sli.c scsi: lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3 2021-01-07 23:02:35 -05:00
lpfc_sli.h scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_version.h scsi: lpfc: Update lpfc version to 12.8.0.6 2020-11-17 00:43:56 -05:00
lpfc_vport.c scsi: lpfc: Update changed file copyrights for 2020 2020-11-17 00:43:56 -05:00
lpfc_vport.h scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00
lpfc.h scsi: lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3 2021-01-07 23:02:35 -05:00
Makefile scsi: lpfc: Revise copyright for new company language 2018-07-10 22:15:09 -04:00