Skip to content

Commit 7bb6cb7

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Fix failure to delete vports when discovery is in progress
Requests to delete an NPIV port may fail repeatedly if the initial request is received during discovery. If the FC_UNLOADING load_flag is set, then skip CT response processing for the physical port. This allows discovery processing for other lpfc_vport objects to reach their cmpl routines before deleting the vport. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20240131185112.149731-8-justintee8345@gmail.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent a801d57 commit 7bb6cb7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
943943
goto out;
944944
}
945945

946-
/* Don't bother processing response if vport is being torn down. */
947-
if (vport->load_flag & FC_UNLOADING) {
946+
/* Skip processing response on pport if unloading */
947+
if (vport == phba->pport && vport->load_flag & FC_UNLOADING) {
948948
if (vport->fc_flag & FC_RSCN_MODE)
949949
lpfc_els_flush_rscn(vport);
950950
goto out;
@@ -1166,8 +1166,8 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11661166
goto out;
11671167
}
11681168

1169-
/* Don't bother processing response if vport is being torn down. */
1170-
if (vport->load_flag & FC_UNLOADING) {
1169+
/* Skip processing response on pport if unloading */
1170+
if (vport == phba->pport && vport->load_flag & FC_UNLOADING) {
11711171
if (vport->fc_flag & FC_RSCN_MODE)
11721172
lpfc_els_flush_rscn(vport);
11731173
goto out;

0 commit comments

Comments
 (0)