Commit 07ebe427 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] set mod->waiter before calling stop_machine

From: Rusty Russell <rusty@rustcorp.com.au>

mod->waiter needs to be set before we try to stop the module: setting it in
__try_stop_module means it gets set to the kthread, not rmmod.
parent b9e55f3d
...@@ -493,7 +493,6 @@ static inline int __try_stop_module(void *_sref) ...@@ -493,7 +493,6 @@ static inline int __try_stop_module(void *_sref)
} }
/* Mark it as dying. */ /* Mark it as dying. */
sref->mod->waiter = current;
sref->mod->state = MODULE_STATE_GOING; sref->mod->state = MODULE_STATE_GOING;
return 0; return 0;
} }
...@@ -588,6 +587,9 @@ sys_delete_module(const char __user *name_user, unsigned int flags) ...@@ -588,6 +587,9 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
} }
} }
/* Set this up before setting mod->state */
mod->waiter = current;
/* Stop the machine so refcounts can't move and disable module. */ /* Stop the machine so refcounts can't move and disable module. */
ret = try_stop_module(mod, flags, &forced); ret = try_stop_module(mod, flags, &forced);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment