Commit ee301369 authored by Douglas Gilbert's avatar Douglas Gilbert Committed by James Bottomley

[PATCH] REQUEST SENSE 254->252 byte response

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.
parent db6c93eb
...@@ -532,14 +532,14 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) ...@@ -532,14 +532,14 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
static int scsi_request_sense(struct scsi_cmnd *scmd) static int scsi_request_sense(struct scsi_cmnd *scmd)
{ {
static unsigned char generic_sense[6] = static unsigned char generic_sense[6] =
{REQUEST_SENSE, 0, 0, 0, 254, 0}; {REQUEST_SENSE, 0, 0, 0, 252, 0};
unsigned char *scsi_result; unsigned char *scsi_result;
int saved_result; int saved_result;
int rtn; int rtn;
memcpy(scmd->cmnd, generic_sense, sizeof(generic_sense)); 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)) { if (unlikely(!scsi_result)) {
...@@ -555,11 +555,11 @@ static int scsi_request_sense(struct scsi_cmnd *scmd) ...@@ -555,11 +555,11 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
* address (db). 0 is not a valid sense code. * address (db). 0 is not a valid sense code.
*/ */
memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer)); memset(scmd->sense_buffer, 0, sizeof(scmd->sense_buffer));
memset(scsi_result, 0, 254); memset(scsi_result, 0, 252);
saved_result = scmd->result; saved_result = scmd->result;
scmd->request_buffer = scsi_result; scmd->request_buffer = scsi_result;
scmd->request_bufflen = 254; scmd->request_bufflen = 252;
scmd->use_sg = 0; scmd->use_sg = 0;
scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
scmd->sc_data_direction = SCSI_DATA_READ; scmd->sc_data_direction = SCSI_DATA_READ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment