Messages in this thread | | | Date | Thu, 25 Jun 1998 13:27:15 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: pre-patch-2.1.107 breaks kmod |
| |
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.
But then it returns the error to kmod, and now the other thread that tried to load it thinks it failed. Boom!
So yes, the actual name thing is atomic. Nothing else is, and that isn't enough.
And you can't make it return success, because when the second thread fails due to the name being already used, the module may not have initialized yet, so if we returned success to kmod, the other thread would incorrectly think that everything was ok, and fail because the module is still busy being loaded..
In short, we _do_ need some extra locking, either in user space or in the kernel. Because we aren't atomic wrt loading and initializing a module as it stands.
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |