Re: request_module rehash

From: Tigran Aivazian (tigran@sco.COM)
Date: Tue Jan 18 2000 - 04:32:16 EST


On Sun, 16 Jan 2000, David Woodhouse wrote:
>
> tigran@sco.COM said:
> > see, the above does the second check only if the module successfully
> > loaded because there is no way for some feature to be added to the
> > kernel otherwise.
>
> What if another CPU loads the module between the first check and the
> request_module()? Then request_module() will fail because the module's already
> loaded, won't it?

which is why (amongst other reasons) you will notice lock/unlock_kernel()
in sys_open() around call to filp_open(). (I just grabbed misc_open() as a
random example of calling request_module() and was satisfied that the code
is safe)

A good exercise would be to go through all calls and see if each case
provides such mutex against itself. Have you done that? :)

Regards,
Tigran.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:17 EST