[16] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

generic scsi bug since 1.1.77 and fix

daemon@ATHENA.MIT.EDU (Heiko Eissfeldt)
Wed Jan 18 11:40:05 1995

From: heiko@colossus.escape.de (Heiko Eissfeldt)
To: linux-scsi@vger.rutgers.edu
Date: Wed, 18 Jan 1995 10:35:19 +0100 (MET)
Cc: jered@mit.edu, eric@aib.com

Hi,

Patch77 has broken the generic scsi interface. I.e. a simple inquiry does not
return any data any more.

I found this to be caused by this patch from patch77:
@@ -291,7 +311,8 @@
   printk("do cmd\n");
 #endif
   scsi_do_cmd (SCpnt,(void *) cmnd,
-               (void *) device->buff,amt,sg_command_done,device->timeout,SG_DEFAULT_RETRIES);
+               (void *) device->buff,device->header.pack_len-size-sizeof(struct sg_header),
+              sg_command_done,device->timeout,SG_DEFAULT_RETRIES);
 #ifdef DEBUG
   printk("done cmd\n");
 #endif

which cuts output buffer size down to input buffer size. Instead maximum has to be used.

So i did:
--- sg.c.org	Tue Jan 17 17:43:26 1995
+++ sg.c	Wed Jan 18 10:06:12 1995
@@ -312,7 +312,7 @@
   printk("do cmd\n");
 #endif
   scsi_do_cmd (SCpnt,(void *) cmnd,
-               (void *) device->buff,device->header.pack_len-size-sizeof(struct sg_header),
+               (void *) device->buff,amt,
 	       sg_command_done,device->timeout,SG_DEFAULT_RETRIES);
 #ifdef DEBUG
   printk("done cmd\n");

which worked for me.

Cheers, Heiko
-- 
Bye 						| computers are more dumb than
Heiko Eissfeldt 				| humans, but smarter than 
heiko@colossus.escape.de			| programmers.



home help back first fref pref prev next nref lref last post