scsi.c module patch (fwd)

Andrea Arcangeli (arcangeli@mbox.queen.it)
Thu, 12 Jun 1997 11:17:32 +0200 (CEST)


I have fixed the bug that causes my kernel to crash doing the script:

#!/bin/sh
while :; do
modprobe ppa
modprobe -r ppa
done

The crash was caused from the execution of the scsi_main_timeout function
by the SCSI_TIMER when the module was just cleared from memory.

So I have stopped the SCSI_TIMER before clear the module from memory.

--- /usr/src/linux/drivers/scsi/scsi.c Wed Jun 11 19:19:36 1997
+++ linux/drivers/scsi/scsi.c Wed Jun 11 19:19:00 1997
@@ -12,6 +12,7 @@
* Rik Faith <faith@cs.unc.edu>
* Tommy Thorn <tthorn>
* Thomas Wuensche <tw@fgb1.fgb.mw.tu-muenchen.de>
+ * Andrea Arcangeli <arcangeli@mbox.queen.it>
*
* Modified by Eric Youngdale eric@aib.com to
* add scatter-gather, multiple outstanding request, and other
@@ -3508,6 +3509,7 @@

void cleanup_module( void)
{
+ timer_active &= ~(1 << SCSI_TIMER);
#if CONFIG_PROC_FS
proc_scsi_unregister(0, PROC_SCSI_SCSI);

Bye!

Andrea Arcangeli
arcangeli@mbox.queen.it

HomePage: http://www.imola.queen.it/user/arcangeli/
Debian Mirror: ftp://dida43.deis.unibo.it/pub/debian/

Debian GNU
__ _ __
/ / (_)__ __ ____ __/ /
/ /__/ / _ \/ // /\ \ /_/
/____/_/_//_/\_,_//_\_(_)