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