Skip to content

Commit 4c113ac

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Check devloss callbk done flag for potential stale NDLP ptrs
Should an rport remain in the NOTPRESENT state it is possible that stgt_delete_work is scheduled after dev_loss_tmo_callbk. In such cases, dev_loss_tmo_callbk would have cleaned up the NDLP object resulting in stale ndlp pointers in lpfc_terminate_rport_io(). Check for the DEVLOSS_CALLBK_DONE flag to know if dev_loss_tmo_callbk has been called. This is a more reliable way to avoid dereferencing stale NDLP pointers. 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 29a6421 commit 4c113ac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ lpfc_rport_invalid(struct fc_rport *rport)
100100
return -EINVAL;
101101
}
102102

103+
if (rport->flags & FC_RPORT_DEVLOSS_CALLBK_DONE) {
104+
pr_info("**** %s: devloss_callbk_done rport x%px SID x%x\n",
105+
__func__, rport, rport->scsi_target_id);
106+
return -EINVAL;
107+
}
108+
103109
rdata = rport->dd_data;
104110
if (!rdata) {
105111
pr_err("**** %s: NULL dd_data on rport x%px SID x%x\n",

0 commit comments

Comments
 (0)