Skip to content

Commit

Permalink
module: remove over-zealous check in __module_get()
Browse files Browse the repository at this point in the history
Impact: fix spurious BUG_ON() triggered under load

module_refcount() isn't reliable outside stop_machine(), as demonstrated
by Karsten Keil <kkeil@suse.de>, 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.

Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Rusty Russell authored and Linus Torvalds committed Feb 7, 2009
1 parent f12b12a commit 7f9a50a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ static inline local_t *__module_ref_addr(struct module *mod, int cpu)
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();
}
Expand Down

0 comments on commit 7f9a50a

Please sign in to comment.