All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhonglin Zhang <zhonglinzh@mobilesoft.com.cn>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.6.11-rc2-mm2 can't insmod modules correctly!
Date: Tue, 01 Feb 2005 15:14:23 +0800	[thread overview]
Message-ID: <1107242063.1881.0.camel@milo> (raw)

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>


                 reply	other threads:[~2005-02-01  7:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1107242063.1881.0.camel@milo \
    --to=zhonglinzh@mobilesoft.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.