lkml.org 
[lkml]   [1998]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.096 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site