public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.11-rc2-mm2 can't insmod modules correctly!
@ 2005-02-01  7:14 Zhonglin Zhang
  0 siblings, 0 replies; only message in thread
From: Zhonglin Zhang @ 2005-02-01  7:14 UTC (permalink / raw)
  To: linux-kernel

Hi,

When I update to the 2.6.11-rc2-mm2, I couldn't insmod any module
successfully.

And I traced the module insert procedure. I got the stop_machine_run()
is defined as do-nothing function when CONFIG_STOP_MACHINE is undefined.
So __link_module can't be called at all.


My little patch is below:


--- kernel/module.c.original    2005-01-31 16:44:37.000000000 +0800
+++ kernel/module.c     2005-02-01 15:01:49.000000000 +0800
@@ -1761,7 +1761,7 @@ static struct module *load_module(void _
  * link the module with the whole machine is stopped with interrupts
off
  * - this defends against kallsyms not taking locks
  */
-static int __link_module(void *_mod)
+static inline int __link_module(void *_mod)
{
        struct module *mod = _mod;
        list_add(&mod->list, &modules);
@@ -1802,7 +1802,9 @@ sys_init_module(void __user *umod,

        /* Now sew it into the lists.  They won't access us, since
            strong_try_module_get() will fail. */
-       stop_machine_run(__link_module, mod, NR_CPUS);
+       spin_lock_irq(&modlist_lock);
+       __link_module(mod);
+       spin_unlock_irq(&modlist_lock);

-- 
Zhonglin Zhang <zhonglinzh@mobilesoft.com.cn>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-01  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-01  7:14 [PATCH] 2.6.11-rc2-mm2 can't insmod modules correctly! Zhonglin Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox