* netlink_proto_init and sock_init
@ 2007-12-27 12:48 Octavian Purdila
2007-12-28 0:41 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Octavian Purdila @ 2007-12-27 12:48 UTC (permalink / raw)
To: netdev
Hi,
I've noticed that with some exotic build setups (e.g. mingw)
netlink_proto_init is called before sock_init and subsequently sock_alloc
runs into a NULL sock_mnt. The following patch seems to fix the problem, but
I'm not sure if this is the right thing to do, as there are no _initcall_sync
calls in the kernel yet.
Thanks,
tavi
PS: please keep me on CC as I am not subscribed to the list.
Author: Octavian Purdila <tavi@cs.pub.ro>
Date: Thu Dec 27 14:25:31 2007 +0200
sock_init needs to be called before netlink_proto_init, but both
sock_init and netlink_proto_init share the same init level
(core). Move netlink_proto_init to sync core level.
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 1f15821..f69c126 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1845,7 +1845,7 @@ panic:
panic("netlink_init: Cannot allocate nl_table\n");
}
-core_initcall(netlink_proto_init);
+core_initcall_sync(netlink_proto_init);
EXPORT_SYMBOL(netlink_ack);
EXPORT_SYMBOL(netlink_run_queue);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: netlink_proto_init and sock_init
2007-12-27 12:48 netlink_proto_init and sock_init Octavian Purdila
@ 2007-12-28 0:41 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-12-28 0:41 UTC (permalink / raw)
To: tavi; +Cc: netdev
From: Octavian Purdila <tavi@cs.pub.ro>
Date: Thu, 27 Dec 2007 14:48:56 +0200
> I've noticed that with some exotic build setups (e.g. mingw)
> netlink_proto_init is called before sock_init and subsequently sock_alloc
> runs into a NULL sock_mnt. The following patch seems to fix the problem, but
> I'm not sure if this is the right thing to do, as there are no _initcall_sync
> calls in the kernel yet.
This means that net/netlink/ got linked before net/socket.o, which
should never happen. net/Makefile reads:
obj-$(CONFIG_NET) := socket.o core/
...
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/
Which ensures that net/socket.o comes before linking in the
net/netlink/built-in.o object file.
Init call ordering is based upon link ordering, so it looks like
mingw is somehow reordering the object files being linked.
There are many other things that can go wrong if the build environment
does this, please find a way to get your mingw build environment to
not do this.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-28 0:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-27 12:48 netlink_proto_init and sock_init Octavian Purdila
2007-12-28 0:41 ` David Miller
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).