struct nvme_fc_ctrl *ctrl = op->ctrl;
struct nvme_fc_queue *queue = op->queue;
struct nvme_completion *cqe = &op->rsp_iu.cqe;
- u16 status;
+ u16 status = NVME_SC_SUCCESS;
/*
* WARNING:
if (atomic_read(&op->state) == FCPOP_STATE_ABORTED)
status = NVME_SC_ABORT_REQ | NVME_SC_DNR;
- else
- status = freq->status;
+ else if (freq->status)
+ status = NVME_SC_FC_TRANSPORT_ERROR;
/*
* For the linux implementation, if we have an unsuccesful
*/
if (freq->transferred_length !=
be32_to_cpu(op->cmd_iu.data_len)) {
- status = -EIO;
+ status = NVME_SC_FC_TRANSPORT_ERROR;
goto done;
}
op->nreq.result.u64 = 0;
freq->transferred_length ||
op->rsp_iu.status_code ||
op->rqno != le16_to_cpu(cqe->command_id))) {
- status = -EIO;
+ status = NVME_SC_FC_TRANSPORT_ERROR;
goto done;
}
op->nreq.result = cqe->result;
break;
default:
- status = -EIO;
+ status = NVME_SC_FC_TRANSPORT_ERROR;
goto done;
}
op->fcp_req.io_dir = io_dir;
op->fcp_req.transferred_length = 0;
op->fcp_req.rcv_rsplen = 0;
- op->fcp_req.status = 0;
+ op->fcp_req.status = NVME_SC_SUCCESS;
op->fcp_req.sqid = cpu_to_le16(queue->qnum);
/*
* transferred. Should equal payload_length on success.
* @rcv_rsplen: length, in bytes, of the FCP RSP IU received.
* @status: Completion status of the FCP operation. must be 0 upon success,
- * NVME_SC_FC_xxx value upon failure. Note: this is NOT a
- * reflection of the NVME CQE completion status. Only the status
- * of the FCP operation at the NVME-FC level.
+ * negative errno value upon failure (ex: -EIO). Note: this is
+ * NOT a reflection of the NVME CQE completion status. Only the
+ * status of the FCP operation at the NVME-FC level.
*/
struct nvmefc_fcp_req {
void *cmdaddr;