Skip to content

Commit 3976beb

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Fix unintentional double clearing of vmid_flag
The vport->vmid_flag is unintentionally cleared twice after an issue_lip via the lpfc_reinit_vmid routine(). The first call to lpfc_reinit_vmid() is in lpfc_cmpl_els_flogi(). Then lpfc_cmpl_els_flogi_fabric() calls lpfc_register_new_vport(), which calls lpfc_cmpl_reg_new_vport() when the mbox command completes and calls lpfc_reinit_vmid() a second time. Fix by moving the vmid_flag clear outside of the lpfc_reinit_vmid() routine so that vmid_flag is only cleared once upon FLOGI completion. 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 2be1d4f commit 3976beb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,8 +1099,10 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
10991099
sp->cmn.priority_tagging, kref_read(&ndlp->kref));
11001100

11011101
/* reinitialize the VMID datastructure before returning */
1102-
if (lpfc_is_vmid_enabled(phba))
1102+
if (lpfc_is_vmid_enabled(phba)) {
11031103
lpfc_reinit_vmid(vport);
1104+
vport->vmid_flag = 0;
1105+
}
11041106
if (sp->cmn.priority_tagging)
11051107
vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA |
11061108
LPFC_VMID_TYPE_PRIO);

drivers/scsi/lpfc/lpfc_vmid.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,5 @@ lpfc_reinit_vmid(struct lpfc_vport *vport)
321321
if (!hash_empty(vport->hash_table))
322322
hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode)
323323
hash_del(&cur->hnode);
324-
vport->vmid_flag = 0;
325324
write_unlock(&vport->vmid_lock);
326325
}

0 commit comments

Comments
 (0)