Skip to content

Commit 15e21dc

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Fix handling of fully recovered fabric node in dev_loss callbk
In rare cases when a fabric node is recovered after a link bounce and before dev_loss_tmo callbk is reached, the driver may leave the fabric node in an inconsistent state with the NLP_IN_DEV_LOSS flag perpetually set. In lpfc_dev_loss_tmo_callbk, a check is added for a recovered fabric node. If the node is recovered, then don't queue the lpfc_dev_loss_tmo_handler work. In lpfc_dev_loss_tmo_handler, the path taken for the recovered fabric nodes is updated to clear the NLP_IN_DEV_LOSS flag. Signed-off-by: Justin Tee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent aeaf117 commit 15e21dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
214214
if (ndlp->nlp_state == NLP_STE_MAPPED_NODE)
215215
return;
216216

217+
/* check for recovered fabric node */
218+
if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE &&
219+
ndlp->nlp_DID == Fabric_DID)
220+
return;
221+
217222
if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn))
218223
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
219224
"6789 rport name %llx != node port name %llx",
@@ -546,6 +551,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
546551
ndlp->nlp_DID, kref_read(&ndlp->kref),
547552
ndlp, ndlp->nlp_flag,
548553
vport->port_state);
554+
spin_lock_irqsave(&ndlp->lock, iflags);
555+
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
556+
spin_unlock_irqrestore(&ndlp->lock, iflags);
549557
return fcf_inuse;
550558
}
551559

0 commit comments

Comments
 (0)