diff options
-rw-r--r-- | net/sunrpc/svc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index a2d3330b70de..cb2caaee2af9 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/kthread.h> | 21 | #include <linux/kthread.h> |
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/nsproxy.h> | ||
23 | 24 | ||
24 | #include <linux/sunrpc/types.h> | 25 | #include <linux/sunrpc/types.h> |
25 | #include <linux/sunrpc/xdr.h> | 26 | #include <linux/sunrpc/xdr.h> |
@@ -368,16 +369,16 @@ svc_pool_for_cpu(struct svc_serv *serv, int cpu) | |||
368 | return &serv->sv_pools[pidx % serv->sv_nrpools]; | 369 | return &serv->sv_pools[pidx % serv->sv_nrpools]; |
369 | } | 370 | } |
370 | 371 | ||
371 | static int svc_rpcb_setup(struct svc_serv *serv) | 372 | static int svc_rpcb_setup(struct svc_serv *serv, struct net *net) |
372 | { | 373 | { |
373 | int err; | 374 | int err; |
374 | 375 | ||
375 | err = rpcb_create_local(&init_net); | 376 | err = rpcb_create_local(net); |
376 | if (err) | 377 | if (err) |
377 | return err; | 378 | return err; |
378 | 379 | ||
379 | /* Remove any stale portmap registrations */ | 380 | /* Remove any stale portmap registrations */ |
380 | svc_unregister(serv, &init_net); | 381 | svc_unregister(serv, net); |
381 | return 0; | 382 | return 0; |
382 | } | 383 | } |
383 | 384 | ||
@@ -470,7 +471,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools, | |||
470 | } | 471 | } |
471 | 472 | ||
472 | if (svc_uses_rpcbind(serv)) { | 473 | if (svc_uses_rpcbind(serv)) { |
473 | if (svc_rpcb_setup(serv) < 0) { | 474 | if (svc_rpcb_setup(serv, current->nsproxy->net_ns) < 0) { |
474 | kfree(serv->sv_pools); | 475 | kfree(serv->sv_pools); |
475 | kfree(serv); | 476 | kfree(serv); |
476 | return NULL; | 477 | return NULL; |