public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: [PATCH] REQUEST SENSE 254->252 byte response
Date: Tue, 24 Jun 2003 18:37:48 +1000	[thread overview]
Message-ID: <3EF80DDC.5080903@torque.net> (raw)

[-- 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;

                 reply	other threads:[~2003-06-24  8:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EF80DDC.5080903@torque.net \
    --to=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox