Hi Brian,

I don't know who wrote (or rewrote) the module loading code, but
I looked at and changed it a bit recently, when doing the workaround
for autopush's brokenness.

It appears that someone intended to track the state of a module
by name, whether loaded or not, and that it was expected that
some operations might be somewhat "asynchronous", for lack of a
better description.  Because of that, I'm guessing that your change
might possibly break something.  I neglected to make this same
change myself because, frankly, I don't understand the intent here
well enough to tell whether it might violate it.

My point is that although I think your fix is likely a good one, I
think it might also be good for this entire approach to module loading
to be revisited.  I was not only wary of changing things without
understanding the author's intent, but I'm also not sure that whatever
it was the author intended was ever adequately implemented.

Can the author of the module loading approach offer some comments
about the "design direction", so that those of us who contribute
patches will be able to tell whether or not our patches are
appropriate or not?

-John

Brian F. G. Bidulock wrote:
There is a module loading bug in head/mod.c  When a module
is unregistered the f_name component is left alloing lis_findmod
to find it an lis_loadmod will attempt to lock a destroyed
semaphore.  The problem can be recreated by manually loading a
streams kernel module (modprobe), unloading it (rmmod) and then
demand loading it (e.g. I_PUSH).  The result is a kernel oops.

The patch below fixes the problem (but may break other things).

--brian

Index: head/mod.c
===================================================================
RCS file: /home/common/cvsroot/LiSnew/head/mod.c,v
retrieving revision 1.1.1.4
diff -U3 -r1.1.1.4 mod.c
--- head/mod.c 22 Nov 2003 23:01:43 -0000 1.1.1.4
+++ head/mod.c 15 Feb 2004 18:05:31 -0000
@@ -742,6 +742,7 @@
lis_up(&slot->f_sem) ;
lis_sem_destroy(&slot->f_sem) ;
slot->f_state &= ~LIS_MODSTATE_INITED ;
+ slot->f_name[0] = '\0';
printk("STREAMS module \"%s\" unregistered, id %d\n", name, id);



_______________________________________________ Linux-streams mailing list [EMAIL PROTECTED] http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams

Reply via email to