diff mbox

[RESEND] scsi: Fix sense information setting in fixed sized format

Message ID 1441298973-27735-1-git-send-email-sagig@mellanox.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sagi Grimberg Sept. 3, 2015, 4:49 p.m. UTC
In fixed size sense format the information field is a four byte
field.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/scsi_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ewan Milne Sept. 3, 2015, 7:02 p.m. UTC | #1
On Thu, 2015-09-03 at 19:49 +0300, Sagi Grimberg wrote:
> In fixed size sense format the information field is a four byte
> field.
> 
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/scsi/scsi_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> index 41432c10dda2..8cfb7eeb5bbc 100644
> --- a/drivers/scsi/scsi_common.c
> +++ b/drivers/scsi/scsi_common.c
> @@ -270,7 +270,7 @@ void scsi_set_sense_information(u8 *buf, u64 info)
>  		put_unaligned_be64(info, &ucp[4]);
>  	} else if ((buf[0] & 0x7f) == 0x70) {
>  		buf[0] |= 0x80;
> -		put_unaligned_be64(info, &buf[3]);
> +		put_unaligned_be32(info, &buf[3]);
>  	}
>  }
>  EXPORT_SYMBOL(scsi_set_sense_information);

Looks correct per SPC-4 4.5.3

And you did post a patch to target for the case where the sector
did not fit in 32 bits, which requires descriptor format sense, so...

Reviewed-by: Ewan D. Milne <emilne@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Sept. 17, 2015, 12:42 p.m. UTC | #2
On 9/3/2015 10:02 PM, Ewan Milne wrote:
> On Thu, 2015-09-03 at 19:49 +0300, Sagi Grimberg wrote:
>> In fixed size sense format the information field is a four byte
>> field.
>>
>> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
>> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
>> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>> ---
>>   drivers/scsi/scsi_common.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
>> index 41432c10dda2..8cfb7eeb5bbc 100644
>> --- a/drivers/scsi/scsi_common.c
>> +++ b/drivers/scsi/scsi_common.c
>> @@ -270,7 +270,7 @@ void scsi_set_sense_information(u8 *buf, u64 info)
>>   		put_unaligned_be64(info, &ucp[4]);
>>   	} else if ((buf[0] & 0x7f) == 0x70) {
>>   		buf[0] |= 0x80;
>> -		put_unaligned_be64(info, &buf[3]);
>> +		put_unaligned_be32(info, &buf[3]);
>>   	}
>>   }
>>   EXPORT_SYMBOL(scsi_set_sense_information);
>
> Looks correct per SPC-4 4.5.3
>
> And you did post a patch to target for the case where the sector
> did not fit in 32 bits, which requires descriptor format sense, so...
>
> Reviewed-by: Ewan D. Milne <emilne@redhat.com>

James, can you pick this up please?

Thanks,
Sagi.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
James Bottomley Sept. 17, 2015, 2:24 p.m. UTC | #3
On Thu, 2015-09-17 at 15:42 +0300, Sagi Grimberg wrote:
> On 9/3/2015 10:02 PM, Ewan Milne wrote:
> > On Thu, 2015-09-03 at 19:49 +0300, Sagi Grimberg wrote:
> >> In fixed size sense format the information field is a four byte
> >> field.
> >>
> >> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> >> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> >> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
> >> Reviewed-by: Christoph Hellwig <hch@lst.de>
> >> ---
> >>   drivers/scsi/scsi_common.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> >> index 41432c10dda2..8cfb7eeb5bbc 100644
> >> --- a/drivers/scsi/scsi_common.c
> >> +++ b/drivers/scsi/scsi_common.c
> >> @@ -270,7 +270,7 @@ void scsi_set_sense_information(u8 *buf, u64 info)
> >>   		put_unaligned_be64(info, &ucp[4]);
> >>   	} else if ((buf[0] & 0x7f) == 0x70) {
> >>   		buf[0] |= 0x80;
> >> -		put_unaligned_be64(info, &buf[3]);
> >> +		put_unaligned_be32(info, &buf[3]);
> >>   	}
> >>   }
> >>   EXPORT_SYMBOL(scsi_set_sense_information);
> >
> > Looks correct per SPC-4 4.5.3
> >
> > And you did post a patch to target for the case where the sector
> > did not fit in 32 bits, which requires descriptor format sense, so...
> >
> > Reviewed-by: Ewan D. Milne <emilne@redhat.com>
> 
> James, can you pick this up please?

It went quietly via the target tree.  I did keep an eye on it because
the target disruption in scsi_sommon.c was why I couldn't send the rest
of your sense descriptor patches via scsi.

commit 12306b425d0dbab7b60f54e02d67cf3dfae494d1

James



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Sept. 17, 2015, 4:47 p.m. UTC | #4
>> James, can you pick this up please?
>
> It went quietly via the target tree.  I did keep an eye on it because
> the target disruption in scsi_sommon.c was why I couldn't send the rest
> of your sense descriptor patches via scsi.
>
> commit 12306b425d0dbab7b60f54e02d67cf3dfae494d1

I didn't notice that. Sorry for the hassle.

Thanks James!
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
index 41432c10dda2..8cfb7eeb5bbc 100644
--- a/drivers/scsi/scsi_common.c
+++ b/drivers/scsi/scsi_common.c
@@ -270,7 +270,7 @@  void scsi_set_sense_information(u8 *buf, u64 info)
 		put_unaligned_be64(info, &ucp[4]);
 	} else if ((buf[0] & 0x7f) == 0x70) {
 		buf[0] |= 0x80;
-		put_unaligned_be64(info, &buf[3]);
+		put_unaligned_be32(info, &buf[3]);
 	}
 }
 EXPORT_SYMBOL(scsi_set_sense_information);