Skip to content

Commit 4ddf01f

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Move NPIV's transport unregistration to after resource clean up
There are cases after NPIV deletion where the fabric switch still believes the NPIV is logged into the fabric. This occurs when a vport is unregistered before the Remove All DA_ID CT and LOGO ELS are sent to the fabric. Currently fc_remove_host(), which calls dev_loss_tmo for all D_IDs including the fabric D_ID, removes the last ndlp reference and frees the ndlp rport object. This sometimes causes the race condition where the final DA_ID and LOGO are skipped from being sent to the fabric switch. Fix by moving the fc_remove_host() and scsi_remove_host() calls after DA_ID and LOGO are sent. 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 91ddb6d commit 4ddf01f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/scsi/lpfc/lpfc_vport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,6 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
674674
lpfc_free_sysfs_attr(vport);
675675
lpfc_debugfs_terminate(vport);
676676

677-
/* Remove FC host to break driver binding. */
678-
fc_remove_host(shost);
679-
scsi_remove_host(shost);
680-
681677
/* Send the DA_ID and Fabric LOGO to cleanup Nameserver entries. */
682678
ndlp = lpfc_findnode_did(vport, Fabric_DID);
683679
if (!ndlp)
@@ -721,6 +717,10 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
721717

722718
skip_logo:
723719

720+
/* Remove FC host to break driver binding. */
721+
fc_remove_host(shost);
722+
scsi_remove_host(shost);
723+
724724
lpfc_cleanup(vport);
725725

726726
/* Remove scsi host now. The nodes are cleaned up. */

0 commit comments

Comments
 (0)