2018-04-09 12:46:17

by Johannes Thumshirn

[permalink] [raw]
Subject: [PATCH] scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION

Bart reports that in qla_isr.c's qla2x00_handle_dif_error we're
wrongly shifting the SAM_STAT_CHECK_CONDITION by one instead of
directly ORing it onto the SCSI command's result.

Signed-off-by: Johannes Thumshirn <[email protected]>
Reported-by: Bart Van Assche <[email protected]>
Cc: Himanshu Madhani <[email protected]>
---
drivers/scsi/qla2xxx/qla_isr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 49d67e1d571f..ed6cdfea00b4 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2195,7 +2195,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
0x10, 0x1);
set_driver_byte(cmd, DRIVER_SENSE);
set_host_byte(cmd, DID_ABORT);
- cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
+ cmd->result |= SAM_STAT_CHECK_CONDITION;
return 1;
}

@@ -2205,7 +2205,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
0x10, 0x3);
set_driver_byte(cmd, DRIVER_SENSE);
set_host_byte(cmd, DID_ABORT);
- cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
+ cmd->result |= SAM_STAT_CHECK_CONDITION;
return 1;
}

@@ -2215,7 +2215,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
0x10, 0x2);
set_driver_byte(cmd, DRIVER_SENSE);
set_host_byte(cmd, DID_ABORT);
- cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
+ cmd->result |= SAM_STAT_CHECK_CONDITION;
return 1;
}

--
2.16.2



2018-04-09 14:04:45

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [PATCH] scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION

On 04/09/2018 02:39 PM, Johannes Thumshirn wrote:
> Bart reports that in qla_isr.c's qla2x00_handle_dif_error we're
> wrongly shifting the SAM_STAT_CHECK_CONDITION by one instead of
> directly ORing it onto the SCSI command's result.
>
> Signed-off-by: Johannes Thumshirn <[email protected]>
> Reported-by: Bart Van Assche <[email protected]>
> Cc: Himanshu Madhani <[email protected]>
> ---
> drivers/scsi/qla2xxx/qla_isr.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index 49d67e1d571f..ed6cdfea00b4 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -2195,7 +2195,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
> 0x10, 0x1);
> set_driver_byte(cmd, DRIVER_SENSE);
> set_host_byte(cmd, DID_ABORT);
> - cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
> + cmd->result |= SAM_STAT_CHECK_CONDITION;
> return 1;
> }
>
> @@ -2205,7 +2205,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
> 0x10, 0x3);
> set_driver_byte(cmd, DRIVER_SENSE);
> set_host_byte(cmd, DID_ABORT);
> - cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
> + cmd->result |= SAM_STAT_CHECK_CONDITION;
> return 1;
> }
>
> @@ -2215,7 +2215,7 @@ qla2x00_handle_dif_error(srb_t *sp, struct sts_entry_24xx *sts24)
> 0x10, 0x2);
> set_driver_byte(cmd, DRIVER_SENSE);
> set_host_byte(cmd, DID_ABORT);
> - cmd->result |= SAM_STAT_CHECK_CONDITION << 1;
> + cmd->result |= SAM_STAT_CHECK_CONDITION;
> return 1;
> }
>
>
Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
[email protected] +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

2018-04-09 14:18:09

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH] scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION

On Mon, 2018-04-09 at 14:39 +0200, Johannes Thumshirn wrote:
> Bart reports that in qla_isr.c's qla2x00_handle_dif_error we're
> wrongly shifting the SAM_STAT_CHECK_CONDITION by one instead of
> directly ORing it onto the SCSI command's result.

Reviewed-by: Bart Van Assche <[email protected]>


2018-04-10 01:23:47

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION


Johannes,

> Bart reports that in qla_isr.c's qla2x00_handle_dif_error we're
> wrongly shifting the SAM_STAT_CHECK_CONDITION by one instead of
> directly ORing it onto the SCSI command's result.

Applied to 4.17/scsi-fixes. Thx!

--
Martin K. Petersen Oracle Linux Engineering