linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Kimmo Sundqvist <rabbit80@mbnet.fi>
Cc: linux-kernel@vger.kernel.org, acme@conectiva.com.br,
	rusty@rustcorp.com.au
Subject: Re: [2.5.69-mm1] kernel BUG at include/linux/module.h:284!
Date: 06 May 2003 06:22:12 -0700	[thread overview]
Message-ID: <1052227331.983.46.camel@rth.ninka.net> (raw)
In-Reply-To: <200305061544.37612.rabbit80@mbnet.fi>

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

On Tue, 2003-05-06 at 05:44, Kimmo Sundqvist wrote:
> Got one like this...
...
> Call Trace:
>  [<f8d7d060>] rawv6_protosw+0x0/0x20 [ipv6]
>  [<c0232b51>] sock_create+0x149/0x264
>  [<f8d7f848>] __icmpv6_socket+0x0/0x8 [ipv6]

Crap.  Well, two problems. Attached is a fix for the first
one, the second one is harder.

Arnaldo, ipv6 creates a socket of it's own type during
module init, try_module_get() on the current module fails
during module load... do you see the problem?

Rusty, you said you were working on a solution for modules
that call themselves during their own init?

-- 
David S. Miller <davem@redhat.com>

[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 1369 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1074  -> 1.1075 
#	 net/ipv6/af_inet6.c	1.32    -> 1.33   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/06	davem@nuts.ninka.net	1.1075
# [IPV6]: Kill spurious module_{get,put}().
# --------------------------------------------
#
diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
--- a/net/ipv6/af_inet6.c	Tue May  6 06:16:05 2003
+++ b/net/ipv6/af_inet6.c	Tue May  6 06:16:05 2003
@@ -111,7 +111,6 @@
 #ifdef INET_REFCNT_DEBUG
 	atomic_dec(&inet6_sock_nr);
 #endif
-	module_put(THIS_MODULE);
 }
 
 static __inline__ kmem_cache_t *inet6_sk_slab(int protocol)
@@ -243,11 +242,6 @@
 	atomic_inc(&inet6_sock_nr);
 	atomic_inc(&inet_sock_nr);
 #endif
-	if (!try_module_get(THIS_MODULE)) {
-		inet_sock_release(sk);
-		return -EBUSY;
-	}
-
 	if (inet->num) {
 		/* It assumes that any protocol which allows
 		 * the user to assign a number at socket
@@ -259,7 +253,6 @@
 	if (sk->prot->init) {
 		int err = sk->prot->init(sk);
 		if (err != 0) {
-			module_put(THIS_MODULE);
 			inet_sock_release(sk);
 			return err;
 		}

  reply	other threads:[~2003-05-06 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 12:44 [2.5.69-mm1] kernel BUG at include/linux/module.h:284! Kimmo Sundqvist
2003-05-06 13:22 ` David S. Miller [this message]
2003-05-07  3:48   ` Rusty Russell
2003-05-07  5:52     ` David S. Miller

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=1052227331.983.46.camel@rth.ninka.net \
    --to=davem@redhat.com \
    --cc=acme@conectiva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabbit80@mbnet.fi \
    --cc=rusty@rustcorp.com.au \
    /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).