public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] REQUEST SENSE 254->252 byte response
@ 2003-06-24  8:37 Douglas Gilbert
  0 siblings, 0 replies; only message in thread
From: Douglas Gilbert @ 2003-06-24  8:37 UTC (permalink / raw)
  To: SCSI Mailing List

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

SPC-3 (rev 13) says that 252 bytes in the maximum (and
recommended) length for a REQUEST SENSE reponse.

Linux asks for 254 bytes in scsi_error.c .

That number was not specified in SPC-2 (although the
allocation length field is 1 byte thus limiting it to
255). Seems as though some numbers are being rounded
down to be multiples of 4.

Doug Gilbert

[-- Attachment #2: scsi_error_2573.diff --]
[-- Type: text/plain, Size: 1165 bytes --]

--- linux/drivers/scsi/scsi_error.c	2003-06-23 17:52:25.000000000 +1000
+++ linux/drivers/scsi/scsi_error.c2573dpg	2003-06-24 18:21:24.999076832 +1000
@@ -532,14 +532,14 @@
 static int scsi_request_sense(struct scsi_cmnd *scmd)
 {
 	static unsigned char generic_sense[6] =
-	{REQUEST_SENSE, 0, 0, 0, 254, 0};
+	{REQUEST_SENSE, 0, 0, 0, 252, 0};
 	unsigned char *scsi_result;
 	int saved_result;
 	int rtn;
 
 	memcpy(scmd->cmnd, generic_sense, sizeof(generic_sense));
 
-	scsi_result = kmalloc(254, GFP_ATOMIC | (scmd->device->host->hostt->unchecked_isa_dma) ? __GFP_DMA : 0);
+	scsi_result = kmalloc(252, GFP_ATOMIC | (scmd->device->host->hostt->unchecked_isa_dma) ? __GFP_DMA : 0);
 
 
 	if (unlikely(!scsi_result)) {
@@ -555,11 +555,11 @@
 	 * address (db).  0 is not a valid sense code. 
 	 */
 	memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
-	memset(scsi_result, 0, 254);
+	memset(scsi_result, 0, 252);
 
 	saved_result = scmd->result;
 	scmd->request_buffer = scsi_result;
-	scmd->request_bufflen = 254;
+	scmd->request_bufflen = 252;
 	scmd->use_sg = 0;
 	scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
 	scmd->sc_data_direction = SCSI_DATA_READ;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-24  8:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24  8:37 [PATCH] REQUEST SENSE 254->252 byte response Douglas Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox