public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: Sridhar Samudrala <sri@us.ibm.com>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Fw: Re: OOPS when force unloading sctp with CONFIG_DEBUG_SLAB enabled
Date: Sat, 20 Mar 2004 21:28:40 +1100	[thread overview]
Message-ID: <1079778517.18641.17.camel@bach> (raw)
In-Reply-To: <20040319160236.1271dd3c.akpm@osdl.org>

On Sat, 2004-03-20 at 11:02, Andrew Morton wrote:
> Some advice on this please?

This patch just went to Linus.  Summary, there is a problem, their
patch makes it worse, but original problem only happens with rmmod
--wait.

BTW, "forced unloading of xxx causes yyy" reports pretty much have
to be ignored.

Cheers,
Rusty.
>From rusty@rustcorp.com.au
From: rusty@rustcorp.com.au
To: torvalds@osdl.org
Subject: [PATCH 1] Set mod->waiter Before Calling stop_machine

Name: Set mod->waiter Before Calling stop_machine
Status: Tested on 2.6.5-rc1-bk4

mod->waiter needs to be set before we try to stop the module: setting
it in __try_stop_module means it gets set to the kthread, not rmmod.

Spotted by someone else, but I can't find the mail... 8(

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .30682-linux-2.6.5-rc1-bk4/kernel/module.c .30682-linux-2.6.5-rc1-bk4.updated/kernel/module.c
--- .30682-linux-2.6.5-rc1-bk4/kernel/module.c	2004-03-20 09:46:01.000000000 +1100
+++ .30682-linux-2.6.5-rc1-bk4.updated/kernel/module.c	2004-03-20 10:06:26.000000000 +1100
@@ -493,7 +493,6 @@ static inline int __try_stop_module(void
 	}
 
 	/* Mark it as dying. */
-	sref->mod->waiter = current;
 	sref->mod->state = MODULE_STATE_GOING;
 	return 0;
 }
@@ -588,6 +587,9 @@ sys_delete_module(const char __user *nam
 		}
 	}
 
+	/* Set this up before setting mod->state */
+	mod->waiter = current;
+
 	/* Stop the machine so refcounts can't move and disable module. */
 	ret = try_stop_module(mod, flags, &forced);
 


-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


           reply	other threads:[~2004-03-20 10:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20040319160236.1271dd3c.akpm@osdl.org>]

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=1079778517.18641.17.camel@bach \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sri@us.ibm.com \
    /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