Skip to content

Commit ef2e3ec

Browse files
igawmartinkpetersen
authored andcommitted
scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request
The qla2xxx driver knows when request was processed successfully or not. But it always sets the NVMe status code to 0/NVME_SC_SUCCESS. The upper layer needs to figure out from the rcv_rsplen and transferred_length variables if the request was transferred successfully. This is not always possible, e.g. when the request data length is 0, the transferred_length is also set 0 which is interpreted as success in nvme_fc_fcpio_done(). Let's inform the upper layer (nvme_fc_fcpio_done()) when something went wrong. nvme_fc_fcpio_done() maps all non-NVME_SC_SUCCESS status codes to NVME_SC_HOST_PATH_ERROR. There isn't any benefit to map the QLA status code to the NVMe status code. Therefore, use NVME_SC_INTERNAL to indicate an error which aligns it with the lpfc driver. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Daniel Wagner <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b8f1d1e commit ef2e3ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ static void qla_nvme_release_fcp_cmd_kref(struct kref *kref)
139139
sp->priv = NULL;
140140
if (priv->comp_status == QLA_SUCCESS) {
141141
fd->rcv_rsplen = le16_to_cpu(nvme->u.nvme.rsp_pyld_len);
142+
fd->status = NVME_SC_SUCCESS;
142143
} else {
143144
fd->rcv_rsplen = 0;
144145
fd->transferred_length = 0;
146+
fd->status = NVME_SC_INTERNAL;
145147
}
146-
fd->status = 0;
147148
spin_unlock_irqrestore(&priv->cmd_lock, flags);
148149

149150
fd->done(fd);

0 commit comments

Comments
 (0)