> > 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.
-- /\_/\ Legalise cannabis now! ( o.o ) Smoke some cannabis today! > ^ < Peace, Love, Unity and Respect to all.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com