Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <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>

authored by

Rusty Russell and committed by
Linus Torvalds
7f9a50a5 f12b12a8

-1
-1
include/linux/module.h
··· 407 407 static inline void __module_get(struct module *module) 408 408 { 409 409 if (module) { 410 - BUG_ON(module_refcount(module) == 0); 411 410 local_inc(__module_ref_addr(module, get_cpu())); 412 411 put_cpu(); 413 412 }