Re: [2.5.69-mm1] kernel BUG at include/linux/module.h:284!

David S. Miller (davem@redhat.com)
06 May 2003 06:22:12 -0700


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-7345-1052229902-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

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>

--=_courier-7345-1052229902-0001-2 Content-Type: text/plain; name=diff; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=diff

# 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=20 # net/ipv6/af_inet6.c 1.32 -> 1.33 =20 # # 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); } =20 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 =3D sk->prot->init(sk); if (err !=3D 0) { - module_put(THIS_MODULE); inet_sock_release(sk); return err; }

--=_courier-7345-1052229902-0001-2--