From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Don't ignore try_stop_module return
Date: Mon, 01 Nov 2004 18:01:45 +1100 [thread overview]
Message-ID: <1099292505.25525.6.camel@localhost.localdomain> (raw)
Name: Fix Module Removal Bug: Don't Ignore try_stop_module Return
Status: Trivial
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Since 2.6.4 we've been ignoring the failure of try_stop_module: it
will normally fail if the module reference count is non-zero. This
would have been mainly unnoticed, since "modprobe -r" checks the usage
count before calling sys_delete_module(), however there is a race
which would cause a hang in this case.
Index: linux-2.6.10-rc1-bk10-Module/kernel/module.c
===================================================================
--- linux-2.6.10-rc1-bk10-Module.orig/kernel/module.c 2004-11-01 17:54:17.861349784 +1100
+++ linux-2.6.10-rc1-bk10-Module/kernel/module.c 2004-11-01 17:57:15.020417512 +1100
@@ -576,6 +576,8 @@
/* Stop the machine so refcounts can't move and disable module. */
ret = try_stop_module(mod, flags, &forced);
+ if (ret != 0)
+ goto out;
/* Never wait if forced. */
if (!forced && module_refcount(mod) != 0)
--
A bad analogy is like a leaky screwdriver -- Richard Braakman
reply other threads:[~2004-11-02 9:33 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=1099292505.25525.6.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=akpm@osdl.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).