2001-02-21 10:30:22

by Nick Holloway

[permalink] [raw]
Subject: 2.2.18: Remove bogus "Wrong buffer length" warnings from aha1542

I've just installed an AHA1542 SCSI card, and when performing a backup,
I'm finding the kernel is spewing out the following message:

Wrong buffer length supplied for request sense (256)

This is because the sense_buffer is 16 bytes, but the buffer supplied
is 256 bytes.

Looking at the 2.4 version of the driver, I see that this message has
been disabled, because scsi_request_sense() provides a buffer of size 256.

The following is a version of the 2.4 patch applied to 2.2. Please apply.

I did notice that aha1740.c also has the same bogus check on the buffer,
but I haven't provided a patch, as this is still present in 2.4, and a
patch for that should also be included.

--- linux-2.2/drivers/scsi/aha1542.c~ Wed Feb 21 10:13:02 2001
+++ linux-2.2/drivers/scsi/aha1542.c Wed Feb 21 10:15:51 2001
@@ -560,7 +560,9 @@
done(SCpnt); return 0;});

if(*cmd == REQUEST_SENSE){
-#ifndef DEBUG
+#if 0
+ /* scsi_request_sense() provides a buffer of size 256,
+ so there is no reason to expect equality */
if (bufflen != sizeof(SCpnt->sense_buffer)) {
printk("Wrong buffer length supplied for request sense (%d)\n",bufflen);
};

--
`O O' | [email protected]
// ^ \\ | http://www.pyrites.org.uk/