]> git.baikalelectronics.ru Git - kernel.git/commit
module: fix symbol waiting when module fails before init
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 28 Sep 2012 05:01:03 +0000 (14:31 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 28 Sep 2012 05:01:03 +0000 (14:31 +0930)
commit16e83ac0458f3793639c680eae80258e9c976366
tree0b56b6817caea8d81c46bbbfe575cd4729ca4a23
parent7c64f3a493ea0ced91377ef35df583994b03f820
module: fix symbol waiting when module fails before init

We use resolve_symbol_wait(), which blocks if the module containing
the symbol is still loading.  However:

1) The module_wq we use is only woken after calling the modules' init
   function, but there are other failure paths after the module is
   placed in the linked list where we need to do the same thing.

2) wake_up() only wakes one waiter, and our waitqueue is shared by all
   modules, so we need to wake them all.

3) wake_up_all() doesn't imply a memory barrier: I feel happier calling
   it after we've grabbed and dropped the module_mutex, not just after
   the state assignment.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
kernel/module.c