From 2b008b0a8e96b726c603c5e1a5a7a509b5f61e35 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Fri, 26 Oct 2007 22:54:53 -0700 Subject: [NET]: Marking struct pernet_operations __net_initdata was inappropriate 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 Signed-off-by: David S. Miller --- include/net/net_namespace.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/net') diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 93aa87d32804..5279466606d2 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h @@ -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 { -- cgit v1.2.2