lkml.org 
[lkml]   [2001]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Minor misc SCSI tweaks
All,

Attached is a small patch fixing some minor misc. SCSI issues (Duncan
Laurie's work). These are against 2.4.6, for general inclusion.

Tim

--
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.comdiff -ruN dist-2.4.6/drivers/scsi/scsi.c cobalt-2.4.6/drivers/scsi/scsi.c
--- dist-2.4.6/drivers/scsi/scsi.c Tue Jun 12 11:06:54 2001
+++ cobalt-2.4.6/drivers/scsi/scsi.c Mon Jul 9 11:04:11 2001
@@ -82,7 +82,7 @@
#endif

/*
- static const char RCSid[] = "$Header: /vger/u4/cvs/linux/drivers/scsi/scsi.c,v 1.38 1997/01/19 23:07:18 davem Exp $";
+ static const char RCSid[] = "$Header: /home/cvs/linux-2.4/drivers/scsi/scsi.c,v 1.1.1.4 2001/05/30 01:05:04 thockin Exp $";
*/

/*
@@ -1823,6 +1823,8 @@
*/
pcount = next_scsi_host;

+ MOD_INC_USE_COUNT;
+
/* The detect routine must carefully spinunlock/spinlock if
it enables interrupts, since all interrupt handlers do
spinlock as well.
@@ -1952,8 +1954,6 @@
(scsi_init_memory_start - scsi_memory_lower_value) / 1024,
(scsi_memory_upper_value - scsi_init_memory_start) / 1024);
#endif
-
- MOD_INC_USE_COUNT;

if (out_of_space) {
scsi_unregister_host(tpnt); /* easiest way to clean up?? */
diff -ruN dist-2.4.6/drivers/scsi/sd.c cobalt-2.4.6/drivers/scsi/sd.c
--- dist-2.4.6/drivers/scsi/sd.c Tue Jun 12 11:17:17 2001
+++ cobalt-2.4.6/drivers/scsi/sd.c Mon Jul 9 11:04:11 2001
@@ -145,6 +151,9 @@
int diskinfo[4];

SDev = rscsi_disks[DEVICE_NR(dev)].device;
+ if (!SDev)
+ return -ENODEV;
+
/*
* If we are in the middle of error recovery, don't let anyone
* else try and use this device. Also, if error recovery fails, it
@@ -502,6 +515,8 @@

target = DEVICE_NR(inode->i_rdev);
SDev = rscsi_disks[target].device;
+ if (!SDev)
+ return -ENODEV;

SDev->access_count--;

@@ -734,8 +759,15 @@
*/

SRpnt = scsi_allocate_request(rscsi_disks[i].device);
+ if (!SRpnt)
+ return i;

buffer = (unsigned char *) scsi_malloc(512);
+ if (!buffer) {
+ scsi_release_request(SRpnt);
+ SRpnt = NULL;
+ return i;
+ }

spintime = 0;
\
 
 \ /
  Last update: 2005-03-22 12:56    [W:0.032 / U:14.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site