mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[PATCH] modules: mark TAINT_FORCED_RMMOD correctly
Currently TAINT_FORCED_RMMOD is totally unused. Because it is marked as TAINT_FORCED_MODULE instead when user forced a module unload. This patch marks it correctly Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
eea8b54dc0
commit
fb1697933a
1 changed files with 5 additions and 5 deletions
|
@ -496,15 +496,15 @@ static void module_unload_free(struct module *mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MODULE_FORCE_UNLOAD
|
#ifdef CONFIG_MODULE_FORCE_UNLOAD
|
||||||
static inline int try_force(unsigned int flags)
|
static inline int try_force_unload(unsigned int flags)
|
||||||
{
|
{
|
||||||
int ret = (flags & O_TRUNC);
|
int ret = (flags & O_TRUNC);
|
||||||
if (ret)
|
if (ret)
|
||||||
add_taint(TAINT_FORCED_MODULE);
|
add_taint(TAINT_FORCED_RMMOD);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline int try_force(unsigned int flags)
|
static inline int try_force_unload(unsigned int flags)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -524,7 +524,7 @@ static int __try_stop_module(void *_sref)
|
||||||
|
|
||||||
/* If it's not unused, quit unless we are told to block. */
|
/* If it's not unused, quit unless we are told to block. */
|
||||||
if ((sref->flags & O_NONBLOCK) && module_refcount(sref->mod) != 0) {
|
if ((sref->flags & O_NONBLOCK) && module_refcount(sref->mod) != 0) {
|
||||||
if (!(*sref->forced = try_force(sref->flags)))
|
if (!(*sref->forced = try_force_unload(sref->flags)))
|
||||||
return -EWOULDBLOCK;
|
return -EWOULDBLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,7 +609,7 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
|
||||||
/* If it has an init func, it must have an exit func to unload */
|
/* If it has an init func, it must have an exit func to unload */
|
||||||
if ((mod->init != NULL && mod->exit == NULL)
|
if ((mod->init != NULL && mod->exit == NULL)
|
||||||
|| mod->unsafe) {
|
|| mod->unsafe) {
|
||||||
forced = try_force(flags);
|
forced = try_force_unload(flags);
|
||||||
if (!forced) {
|
if (!forced) {
|
||||||
/* This module can't be removed */
|
/* This module can't be removed */
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
|
|
Loading…
Reference in a new issue