Re: [PATCH 08/39] scsi: Kill DRIVER_SENSE

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

 



On 4/23/21 4:39 AM, Hannes Reinecke wrote:
> Introduce scsi_status_is_check_condition()

Wasn't that macro introduced by patch 07/39?

> For backwards compability move the DRIVER_SENSE definition
                ^^^^^^^^^^^
                  typo?

> diff --git a/block/bsg.c b/block/bsg.c
> index bd10922d5cbb..a70bb25ab906 100644
> --- a/block/bsg.c
> +++ b/block/bsg.c
> @@ -97,6 +97,8 @@ static int bsg_scsi_complete_rq(struct request *rq, struct sg_io_v4 *hdr)
>  	hdr->device_status = sreq->result & 0xff;
>  	hdr->transport_status = host_byte(sreq->result);
>  	hdr->driver_status = driver_byte(sreq->result);
> +	if (scsi_status_is_check_condition(sreq->result))
> +		hdr->driver_status |= DRIVER_SENSE;

If another value is already present in the driver_byte(), will |=
DRIVER_SENSE corrupt that value?

> diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
> index 99d58786e0d5..e59e1f70f3a5 100644
> --- a/block/scsi_ioctl.c
> +++ b/block/scsi_ioctl.c
> @@ -257,6 +257,8 @@ static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
>  	hdr->msg_status = msg_byte(req->result);
>  	hdr->host_status = host_byte(req->result);
>  	hdr->driver_status = driver_byte(req->result);
> +	if (hdr->status == SAM_STAT_CHECK_CONDITION)
> +		hdr->driver_status |= DRIVER_SENSE;

Same here: since "driver_status" is not a bitfield, "|=" seems
conceptually wrong to me.

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