aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-12-10 12:19:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 07:29:43 -0800
commitb79811fc009205e700039a997ea5b0b9b44bd260 (patch)
tree4368d1a723cf6e3898e5b1adcbedddebde58b7e7 /fs
parent98048d9b597625034b47f7e0bd04595b6002a045 (diff)
nfsd: use "init_net" for portmapper
commit f7fb86c6e639360ad9c253cec534819ef928a674 upstream. There could be a situation, when NFSd was started in one network namespace, but stopped in another one. This will trigger kernel panic, because RPCBIND client is stored on per-net NFSd data, and will be NULL on NFSd shutdown. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfssvc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 53459b055cf..25d839ed0ae 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -11,7 +11,6 @@
#include <linux/module.h>
#include <linux/fs_struct.h>
#include <linux/swap.h>
-#include <linux/nsproxy.h>
#include <linux/sunrpc/stats.h>
#include <linux/sunrpc/svcsock.h>
@@ -330,7 +329,7 @@ static int nfsd_get_default_max_blksize(void)
int nfsd_create_serv(void)
{
int error;
- struct net *net = current->nsproxy->net_ns;
+ struct net *net = &init_net;
WARN_ON(!mutex_is_locked(&nfsd_mutex));
if (nfsd_serv) {