From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stanislav Kinsbursky , "J. Bruce Fields" , Weng Meiling Subject: [PATCH 3.4 27/32] nfsd: use "init_net" for portmapper Date: Fri, 6 Dec 2013 13:52:37 -0800 Message-Id: <20131206214959.303285625@linuxfoundation.org> In-Reply-To: <20131206214956.830407026@linuxfoundation.org> References: <20131206214956.830407026@linuxfoundation.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stanislav Kinsbursky 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 Signed-off-by: J. Bruce Fields Signed-off-by: Weng Meiling Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfssvc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -330,7 +329,7 @@ static int nfsd_get_default_max_blksize( 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) {