From: Stanislav Kinsbursky Date: Mon, 10 Dec 2012 09:19:04 +0000 (+0300) Subject: nfsd: use "init_net" for portmapper X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f7fb86c6e639360ad9c253cec534819ef928a674;p=linux-beck.git nfsd: use "init_net" for portmapper 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 Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index b34a67d8ec44..9beace6a868c 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -341,7 +340,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) {