Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: lpfc: Fix LUN loss after cable pull

On devices that support FCP sequence error recovery, which attempts to
preserve the devices login across link bounce, adisc is used for device
validation. Turns out the device fc4 type is cleared as part of the link
bounce, but the ADISC handling doesn't restore the FC4 support as it
normally would with a PRLI. This caused situations where the device wasn't
reregistered with the transport thus scan logic and LUN discovery never
kicked in.

In the ADISC completion handling, reset the fc4 type so that transport port
reregistration occurs with the remote port.

Link: https://lore.kernel.org/r/20200803210229.23063-8-jsmart2021@gmail.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>

authored by

Dick Kennedy and committed by
Martin K. Petersen
00081c5c feb3cc57

+7 -1
+7 -1
drivers/scsi/lpfc/lpfc_nportdisc.c
··· 1745 1745 } 1746 1746 } 1747 1747 1748 - if (ndlp->nlp_type & NLP_FCP_TARGET) { 1748 + if (ndlp->nlp_type & NLP_FCP_TARGET) 1749 + ndlp->nlp_fc4_type |= NLP_FC4_FCP; 1750 + 1751 + if (ndlp->nlp_type & NLP_NVME_TARGET) 1752 + ndlp->nlp_fc4_type |= NLP_FC4_NVME; 1753 + 1754 + if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) { 1749 1755 ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; 1750 1756 lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); 1751 1757 } else {