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

David S. Miller (davem@redhat.com)
Tue, 06 May 2003 22:52:23 -0700 (PDT)


From: Rusty Russell <rusty@rustcorp.com.au>
Date: Wed, 07 May 2003 13:48:15 +1000

In message <1052227331.983.46.camel@rth.ninka.net> you write:
> 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?

In fact, it's backwards.

You're, of course, right. I misread the bug report, and this
patch below ought to fix it. It's untested, but I'll do that in
a bit and push upstream.

# 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.1083 -> 1.1084
# net/ipv4/af_inet.c 1.44 -> 1.45
# net/ipv6/af_inet6.c 1.33 -> 1.34
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/06 davem@nuts.ninka.net 1.1084
# [IPV4/IPV6]: Set owner field in family ops.
# --------------------------------------------
#
diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
--- a/net/ipv4/af_inet.c Tue May 6 23:58:43 2003
+++ b/net/ipv4/af_inet.c Tue May 6 23:58:43 2003
@@ -926,6 +926,7 @@
struct net_proto_family inet_family_ops = {
.family = PF_INET,
.create = inet_create,
+ .owner = THIS_MODULE,
};


diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
--- a/net/ipv6/af_inet6.c Tue May 6 23:58:43 2003
+++ b/net/ipv6/af_inet6.c Tue May 6 23:58:43 2003
@@ -535,6 +535,7 @@
struct net_proto_family inet6_family_ops = {
.family = PF_INET6,
.create = inet6_create,
+ .owner = THIS_MODULE,
};

#ifdef MODULE
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/