]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: Marking struct pernet_operations __net_initdata was inappropriate
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 27 Oct 2007 05:54:53 +0000 (22:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Oct 2007 05:54:53 +0000 (22:54 -0700)
It is not safe to to place struct pernet_operations in a special section.
We need struct pernet_operations to last until we call unregister_pernet_subsys.
Which doesn't happen until module unload.

So marking struct pernet_operations is a disaster for modules in two ways.
- We discard it before we call the exit method it points to.
- Because I keep struct pernet_operations on a linked list discarding
  it for compiled in code removes elements in the middle of a linked
  list and does horrible things for linked insert.

So this looks safe assuming __exit_refok is not discarded
for modules.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/loopback.c
fs/proc/proc_net.c
include/net/net_namespace.h
net/core/dev.c
net/core/dev_mcast.c
net/netlink/af_netlink.c

index 662b8d16803ce7fec85f59af645b60aabee75c41..45f30a2974b8f49405ec5ab07e4e605c6be60cb8 100644 (file)
@@ -284,7 +284,7 @@ static __net_exit void loopback_net_exit(struct net *net)
        unregister_netdev(dev);
 }
 
-static struct pernet_operations __net_initdata loopback_net_ops = {
+static struct pernet_operations loopback_net_ops = {
        .init = loopback_net_init,
        .exit = loopback_net_exit,
 };
index 4edaad0d995ffa1f84af4b2a3856e14db622d313..749def054a341b62ff8f542a4bfa21bf5e93821a 100644 (file)
@@ -185,7 +185,7 @@ static __net_exit void proc_net_ns_exit(struct net *net)
        kfree(net->proc_net_root);
 }
 
-static struct pernet_operations __net_initdata proc_net_ns_ops = {
+static struct pernet_operations proc_net_ns_ops = {
        .init = proc_net_ns_init,
        .exit = proc_net_ns_exit,
 };
index 93aa87d328040b71877a31ee400e7adebd3e2073..5279466606d2bb33625431c4d6f000ddbbbd9c29 100644 (file)
@@ -102,11 +102,9 @@ static inline void release_net(struct net *net)
 #ifdef CONFIG_NET_NS
 #define __net_init
 #define __net_exit
-#define __net_initdata
 #else
 #define __net_init     __init
 #define __net_exit     __exit_refok
-#define __net_initdata __initdata
 #endif
 
 struct pernet_operations {
index ddfef3b45babd9486b00752c696c3b96addb653d..853c8b575f1d51d2300433073d8e1795b85806a5 100644 (file)
@@ -2668,7 +2668,7 @@ static void __net_exit dev_proc_net_exit(struct net *net)
        proc_net_remove(net, "dev");
 }
 
-static struct pernet_operations __net_initdata dev_proc_ops = {
+static struct pernet_operations dev_proc_ops = {
        .init = dev_proc_net_init,
        .exit = dev_proc_net_exit,
 };
@@ -4328,7 +4328,7 @@ static void __net_exit netdev_exit(struct net *net)
        kfree(net->dev_index_head);
 }
 
-static struct pernet_operations __net_initdata netdev_net_ops = {
+static struct pernet_operations  netdev_net_ops = {
        .init = netdev_init,
        .exit = netdev_exit,
 };
@@ -4359,7 +4359,7 @@ static void __net_exit default_device_exit(struct net *net)
        rtnl_unlock();
 }
 
-static struct pernet_operations __net_initdata default_device_ops = {
+static struct pernet_operations  default_device_ops = {
        .exit = default_device_exit,
 };
 
index 15241cf48af8a8b835a502978e1777c6c2d8ab12..ae354057d84cf5101b89126e343ce3903eed55d2 100644 (file)
@@ -285,7 +285,7 @@ static void __net_exit dev_mc_net_exit(struct net *net)
        proc_net_remove(net, "dev_mcast");
 }
 
-static struct pernet_operations __net_initdata dev_mc_net_ops = {
+static struct pernet_operations dev_mc_net_ops = {
        .init = dev_mc_net_init,
        .exit = dev_mc_net_exit,
 };
index 325272925d0f32ba2e5f60058ae71197f6d4a1be..4f994c0fb3f80dcc4542a4e7a17475637601b690 100644 (file)
@@ -1888,7 +1888,7 @@ static void __net_exit netlink_net_exit(struct net *net)
 #endif
 }
 
-static struct pernet_operations __net_initdata netlink_net_ops = {
+static struct pernet_operations netlink_net_ops = {
        .init = netlink_net_init,
        .exit = netlink_net_exit,
 };