提交 91455b85 编写于 作者: J James Smart 提交者: Martin K. Petersen

scsi: lpfc: Fix IO failure during hba reset testing with nvme io.

A stress test repeatedly resetting the adapter while performing io would
eventually report I/O failures and missing nvme namespaces.

The driver was setting the nvmefc_fcp_req->private pointer to NULL
during the IO completion routine before upcalling done().  If the
transport was also running an abort for that IO, the driver would fail
the abort with message 6140. Failing the abort is not allowed by the
nvme-fc transport, as it mandates that the io must be returned back to
the transport. As that does not happen, the transport controller delete
has an outstanding reference and can't complete teardown.

The NULL-ing of the private pointer should be done only when the io is
considered complete. It's complete when the adapter returns the exchange
with the "exchange busy" flag clear.

Move the NULL'ing of the structure to the done case. This leaves the io
contexts set while it is busy and until the subsequent XRI_ABORTED
completion which returns the exchange is received.
Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: NJames Smart <james.smart@broadcom.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 2c3b2a8f
...@@ -980,14 +980,14 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, ...@@ -980,14 +980,14 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
phba->cpucheck_cmpl_io[lpfc_ncmd->cpu]++; phba->cpucheck_cmpl_io[lpfc_ncmd->cpu]++;
} }
#endif #endif
freqpriv = nCmd->private;
freqpriv->nvme_buf = NULL;
/* NVME targets need completion held off until the abort exchange /* NVME targets need completion held off until the abort exchange
* completes unless the NVME Rport is getting unregistered. * completes unless the NVME Rport is getting unregistered.
*/ */
if (!(lpfc_ncmd->flags & LPFC_SBUF_XBUSY)) { if (!(lpfc_ncmd->flags & LPFC_SBUF_XBUSY)) {
freqpriv = nCmd->private;
freqpriv->nvme_buf = NULL;
nCmd->done(nCmd); nCmd->done(nCmd);
lpfc_ncmd->nvmeCmd = NULL; lpfc_ncmd->nvmeCmd = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册