diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-04-05 13:04:37 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-18 11:05:48 -0400 |
commit | adae0fe0ea87e8fb1a72dde304937c60759b495f (patch) | |
tree | 27cab6b39b71e4264779a3123b62d49e6afb0a17 /net/sunrpc/sunrpc_syms.c | |
parent | 6c216ec636f75d834461be15f83ec41a6759bd2b (diff) |
SUNRPC: register PipeFS file system after pernet sybsystem
PipeFS superblock creation routine relays on SUNRPC pernet data presense, which
is created on register_pernet_subsys() call in SUNRPC module init function.
Registering of PipeFS filesystem prior to registering of per-net subsystem
leads to races (mount of PipeFS can dereference uninitialized data).
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/sunrpc_syms.c')
-rw-r--r-- | net/sunrpc/sunrpc_syms.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c index 8adfc88e793a..3d6498af9adc 100644 --- a/net/sunrpc/sunrpc_syms.c +++ b/net/sunrpc/sunrpc_syms.c | |||
@@ -75,20 +75,21 @@ static struct pernet_operations sunrpc_net_ops = { | |||
75 | static int __init | 75 | static int __init |
76 | init_sunrpc(void) | 76 | init_sunrpc(void) |
77 | { | 77 | { |
78 | int err = register_rpc_pipefs(); | 78 | int err = rpc_init_mempool(); |
79 | if (err) | 79 | if (err) |
80 | goto out; | 80 | goto out; |
81 | err = rpc_init_mempool(); | ||
82 | if (err) | ||
83 | goto out2; | ||
84 | err = rpcauth_init_module(); | 81 | err = rpcauth_init_module(); |
85 | if (err) | 82 | if (err) |
86 | goto out3; | 83 | goto out2; |
87 | 84 | ||
88 | cache_initialize(); | 85 | cache_initialize(); |
89 | 86 | ||
90 | err = register_pernet_subsys(&sunrpc_net_ops); | 87 | err = register_pernet_subsys(&sunrpc_net_ops); |
91 | if (err) | 88 | if (err) |
89 | goto out3; | ||
90 | |||
91 | err = register_rpc_pipefs(); | ||
92 | if (err) | ||
92 | goto out4; | 93 | goto out4; |
93 | #ifdef RPC_DEBUG | 94 | #ifdef RPC_DEBUG |
94 | rpc_register_sysctl(); | 95 | rpc_register_sysctl(); |
@@ -98,11 +99,11 @@ init_sunrpc(void) | |||
98 | return 0; | 99 | return 0; |
99 | 100 | ||
100 | out4: | 101 | out4: |
101 | rpcauth_remove_module(); | 102 | unregister_pernet_subsys(&sunrpc_net_ops); |
102 | out3: | 103 | out3: |
103 | rpc_destroy_mempool(); | 104 | rpcauth_remove_module(); |
104 | out2: | 105 | out2: |
105 | unregister_rpc_pipefs(); | 106 | rpc_destroy_mempool(); |
106 | out: | 107 | out: |
107 | return err; | 108 | return err; |
108 | } | 109 | } |