[3844] in linux-scsi channel archive

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

essential fix to scsi.c (up to 2.1.100-1)

daemon@ATHENA.MIT.EDU (Dario_Ballabio)
Mon May 4 06:42:35 1998

Date: 	Mon, 4 May 1998 12:37:11 +0200
From: Dario_Ballabio@milano.europe.dg.com (Dario_Ballabio)
To: linux-scsi@vger.rutgers.edu, linux-kernel@vger.rutgers.edu,
        torvalds@transmeta.com

The enclosed patch to scsi.c, applied on top of 2.1.100-1 changed my
PC (uniprocessor but compiled with SMP=1) with one AHA2940 and one
DPT PM3224W from crashing every few minutes to fully reliable.
Maybe the locking strategy in scsi_bottom_half_handler can be
totally revisited, but the io_rw_lock is definetly required.

-db
%UATTACH
diff -r -u linux-2.1.100-1/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- linux-2.1.100-1/drivers/scsi/scsi.c\011Tue Apr 28 21:58:58 1998
+++ linux/drivers/scsi/scsi.c\011Mon May  4 11:31:36 1998
@@ -1605,6 +1605,7 @@
       if( SCpnt == NULL )
           return;
       
+      spin_lock_irqsave(&io_request_lock, flags);
       atomic_inc(&recursion_depth);
       
       SCnext = SCpnt->bh_next;
@@ -1696,6 +1697,7 @@
       } /* for(; SCpnt...) */
 
       atomic_dec(&recursion_depth);
+      spin_unlock_irqrestore(&io_request_lock, flags);
 
   } /* while(1==1) */
 

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

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