Skip to content

Commit f408dde

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Check return status of lpfc_reset_flush_io_context during TGT_RESET
If lpfc_reset_flush_io_context fails to execute, then the wrong return status code may be passed back to upper layers when issuing a target reset TMF command. Fix by checking the return status from lpfc_reset_flush_io_context() first in order to properly return FAILED or FAST_IO_FAIL. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Message-ID: <20250915180811.137530-7-justintee8345@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b5bf6d6 commit f408dde

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/scsi/lpfc/lpfc_scsi.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5935,7 +5935,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct fc_rport *rport)
59355935
/**
59365936
* lpfc_reset_flush_io_context -
59375937
* @vport: The virtual port (scsi_host) for the flush context
5938-
* @tgt_id: If aborting by Target contect - specifies the target id
5938+
* @tgt_id: If aborting by Target context - specifies the target id
59395939
* @lun_id: If aborting by Lun context - specifies the lun id
59405940
* @context: specifies the context level to flush at.
59415941
*
@@ -6109,8 +6109,14 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
61096109
pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE;
61106110
spin_unlock_irqrestore(&pnode->lock, flags);
61116111
}
6112-
lpfc_reset_flush_io_context(vport, tgt_id, lun_id,
6113-
LPFC_CTX_TGT);
6112+
status = lpfc_reset_flush_io_context(vport, tgt_id, lun_id,
6113+
LPFC_CTX_TGT);
6114+
if (status != SUCCESS) {
6115+
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
6116+
"0726 Target Reset flush status x%x\n",
6117+
status);
6118+
return status;
6119+
}
61146120
return FAST_IO_FAIL;
61156121
}
61166122

@@ -6202,7 +6208,7 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd)
62026208
int rc, ret = SUCCESS;
62036209

62046210
lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
6205-
"3172 SCSI layer issued Host Reset Data:\n");
6211+
"3172 SCSI layer issued Host Reset\n");
62066212

62076213
lpfc_offline_prep(phba, LPFC_MBX_WAIT);
62086214
lpfc_offline(phba);

0 commit comments

Comments
 (0)