* [PATCH] scsi_debug: GET LBA STATUS response length correction
@ 2012-01-20 0:30 Douglas Gilbert
2012-01-24 18:47 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Douglas Gilbert @ 2012-01-20 0:30 UTC (permalink / raw)
To: SCSI development list; +Cc: Martin K. Petersen
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]
The SCSI GET LBA STATUS command was introduced in SBC-3 revision
20 in September 2009. At that time the Parameter Data Length
field in the response had an associated byte offset of 8.
Then in SBC-3 revision 25 (October 2010) that byte offset was
changed to 4. The sg_get_lba_status utility in sg3_utils version
1.33 (released earlier today) has been changed to calculate
the newer response length. However the implementation of
GET LBA STATUS command in the scsi_debug driver still uses the
original byte offset.
Changelog:
- modify the Parameter Data Length field value in the GET LBA
STATUS command response to comply with the change in SBC-3
revision 25
Doug Gilbert
[-- Attachment #2: sdebug32_getlba.patch --]
[-- Type: text/x-patch, Size: 605 bytes --]
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 6888b2c..d2fd0ef 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2220,7 +2220,7 @@ static int resp_get_lba_status(struct scsi_cmnd * scmd,
mapped = map_state(lba, &num);
memset(arr, 0, SDEBUG_GET_LBA_STATUS_LEN);
- put_unaligned_be32(16, &arr[0]); /* Parameter Data Length */
+ put_unaligned_be32(20, &arr[0]); /* Parameter Data Length */
put_unaligned_be64(lba, &arr[8]); /* LBA */
put_unaligned_be32(num, &arr[16]); /* Number of blocks */
arr[20] = !mapped; /* mapped = 0, unmapped = 1 */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi_debug: GET LBA STATUS response length correction
2012-01-20 0:30 [PATCH] scsi_debug: GET LBA STATUS response length correction Douglas Gilbert
@ 2012-01-24 18:47 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2012-01-24 18:47 UTC (permalink / raw)
To: dgilbert; +Cc: SCSI development list, Martin K. Petersen
>>>>> "Doug" == Douglas Gilbert <dgilbert@interlog.com> writes:
Doug> The SCSI GET LBA STATUS command was introduced in SBC-3 revision
Doug> 20 in September 2009. At that time the Parameter Data Length field
Doug> in the response had an associated byte offset of 8.
Doug> Then in SBC-3 revision 25 (October 2010) that byte offset was
Doug> changed to 4. The sg_get_lba_status utility in sg3_utils version
Doug> 1.33 (released earlier today) has been changed to calculate
Doug> the newer response length. However the implementation of GET LBA
Doug> STATUS command in the scsi_debug driver still uses the original
Doug> byte offset.
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-24 18:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-20 0:30 [PATCH] scsi_debug: GET LBA STATUS response length correction Douglas Gilbert
2012-01-24 18:47 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.