Re: [PATCH 12/39] xen-scsifront: compability status handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/23/21 4:39 AM, Hannes Reinecke wrote:
> 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.
> 
> Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
> ---
>  drivers/scsi/xen-scsifront.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
> index 259fc248d06c..0d813a2d9ad2 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) & 0xff)
> +		set_host_byte(sc, DID_ERROR);
> +	else
> +		set_host_byte(sc, host_byte(result));
> +	set_status_byte(sc, result & 0xff);

The "& 0xff" isn't necessary in "(result >> 24) & 0xff" since 'result'
is a 32-bit variable.

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux