summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-04-27 10:30:19 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2021-05-31 22:48:22 -0400
commitb840abeffc23c5bf2e4dd53f0448d72bdedf1666 (patch)
tree3b38de0aaf13a430043b016d2b47a00e06079dfa
parent58bedf351f3eace10447b5e1f70b9079ab4d04d2 (diff)
downloadlwn-b840abeffc23c5bf2e4dd53f0448d72bdedf1666.tar.gz
lwn-b840abeffc23c5bf2e4dd53f0448d72bdedf1666.zip
scsi: xen-scsifront: Compability status handling
The Xen guest might run against arbitrary backends, so the driver might receive a status with driver_byte set. Map these errors to DID_ERROR to be consistent with recent changes. Link: https://lore.kernel.org/r/20210427083046.31620-14-hare@suse.de Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/xen-scsifront.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index 259fc248d06c..ec9d399fbbd8 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -251,6 +251,7 @@ static void scsifront_cdb_cmd_done(struct vscsifrnt_info *info,
struct scsi_cmnd *sc;
uint32_t id;
uint8_t sense_len;
+ int result;
id = ring_rsp->rqid;
shadow = info->shadow[id];
@@ -261,7 +262,12 @@ static void scsifront_cdb_cmd_done(struct vscsifrnt_info *info,
scsifront_gnttab_done(info, shadow);
scsifront_put_rqid(info, id);
- sc->result = ring_rsp->rslt;
+ result = ring_rsp->rslt;
+ if (result >> 24)
+ set_host_byte(sc, DID_ERROR);
+ else
+ set_host_byte(sc, host_byte(result));
+ set_status_byte(sc, result & 0xff);
scsi_set_resid(sc, ring_rsp->residual_len);
sense_len = min_t(uint8_t, VSCSIIF_SENSE_BUFFERSIZE,