Skip to contentSkip to conversation

module: remove over-zealous check in __module_get()

PATCH New Rusty Russell 1 participant 1 message Feb 7, 2009 Module support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 module: remove over-zealous check in __module_get()

Impact: fix spurious BUG_ON() triggered under load

module_refcount() isn't reliable outside stop_machine(), as demonstrated by Karsten Keil <[email protected]>, networking can trigger it under load (an inc on one cpu and dec on another while module_refcount() is tallying
can give false results, for example).

Almost noone should be using __module_get, but that's another issue.

---
 include/linux/module.h |    1 -
 1 file changed, 1 deletion(-)
include/linux/module.h +0 -1
@@ -407,7 +407,6 @@ static inline void __module_get(struct m
 static inline void __module_get(struct module *module)
 {
 	if (module) {
-		BUG_ON(module_refcount(module) == 0);
 		local_inc(__module_ref_addr(module, get_cpu()));
 		put_cpu();
 	}