Re: 1.3.100 Oops, kerneld/isofs module ?

Bjorn Ekwall (bj0rn@blox.se)
Sun, 12 May 1996 12:50:56 +0200 (MET DST)


Gerd Knorr <kraxel@cs.tu-berlin.de> wrote:
>
> Got this oops today. I changed the CD, and while mounting the new one, I
> got this:
[...]
>
> The EDI Register referes to 0184b5a4. When insmod'ing the isofs module,
> it gets loaded into this area. I assume the following happend:
>
> - entered 'mount' command
> - the drive closed the tray
> - while the drive logged in the cdrom, kerneld removed the isofs-module
> (5 sec are enouth)
> - cdrom signaled 'ready', kernel tried to mount the CD ==> Oops

I suspect that it is the CD-ROM driver that got reaped by kerneld.
(A "lsmod" after the Oops might tell if I'm correct...)

It seems that some modules, CD-ROM drivers in particular, are lying
about whether they are in use or not.

The problem is that they are not doing MOD_INC_USE_COUNT until the _end_
of their *_open functions, while they in fact _are_ using kernel resources
long before that...

If they sleep in some way _before_ incrementing the usage counter, there
will certainly be problems!

Try this patch to linux/drivers/cdrom/gscd.c (I think you are using that one):

--- linux-1.3.100/drivers/cdrom/gscd.c Sun May 12 12:43:49 1996
+++ linux/drivers/cdrom/gscd.c Sun May 12 12:48:09 1996
@@ -370,11 +370,14 @@
if (gscdPresent == 0)
return -ENXIO; /* no hardware */

+ MOD_INC_USE_COUNT;
+
get_status ();
st = disk_state & (ST_NO_DISK | ST_DOOR_OPEN);
if ( st )
{
printk ( "GSCD: no disk or door open\n" );
+ MOD_DEC_USE_COUNT;
return -ENXIO;
}

@@ -382,8 +385,6 @@
return -EIO;
*/

- MOD_INC_USE_COUNT;
-
return 0;
}

Bjorn