Commit b79811fc authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Greg Kroah-Hartman

nfsd: use "init_net" for portmapper

commit f7fb86c6 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: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarWeng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 98048d9b
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs_struct.h> #include <linux/fs_struct.h>
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/nsproxy.h>
#include <linux/sunrpc/stats.h> #include <linux/sunrpc/stats.h>
#include <linux/sunrpc/svcsock.h> #include <linux/sunrpc/svcsock.h>
...@@ -330,7 +329,7 @@ static int nfsd_get_default_max_blksize(void) ...@@ -330,7 +329,7 @@ static int nfsd_get_default_max_blksize(void)
int nfsd_create_serv(void) int nfsd_create_serv(void)
{ {
int error; int error;
struct net *net = current->nsproxy->net_ns; struct net *net = &init_net;
WARN_ON(!mutex_is_locked(&nfsd_mutex)); WARN_ON(!mutex_is_locked(&nfsd_mutex));
if (nfsd_serv) { if (nfsd_serv) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment