Re: pre-patch-2.1.107 breaks kmod

Alex Buell (alex.buell@tahallah.demon.co.uk)
Thu, 25 Jun 1998 21:24:24 -0400 (EDT)


On Thu, 25 Jun 1998, Alan Cox wrote:

> > The problem is that without the lock, it _isn't_ atomic.
>
> Im only locking the code that checks the name is present. So I get two
> insmods fire up, both try to register "blah" in the module table, one
> bombs with an error. That avoids the problems with the fact module
> loading is fundamentally recursive.

Actually, what happens if two threads/processes tries to load the module
via the kmod handler? One succeeds and the other gets an error from kmod.
That could be critical depending on what these threads/processes are
doing. The only way to ensure this doesn't happen is to *serialise* the
loading of the modules such that the first one to call the kmod handler
locks it down and loads the module, then releases it, and then the second
one can tell kmod to load the module and finds it's already there.

It's necessary in my opinion.

Cheers,
Alex

--
 /\_/\  Legalise cannabis now! 
( o.o ) Smoke some cannabis today!
 > ^ <  Peace, Love, Unity and Respect to all.

http://www.tahallah.demon.co.uk

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