From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759775Ab3LFV4U (ORCPT ); Fri, 6 Dec 2013 16:56:20 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:32948 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759603Ab3LFVyX (ORCPT ); Fri, 6 Dec 2013 16:54:23 -0500 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> X-Mailer: git-send-email 1.8.5.1.67.gb00d244 In-Reply-To: <20131206214956.830407026@linuxfoundation.org> References: <20131206214956.830407026@linuxfoundation.org> User-Agent: quilt/0.60-8.1.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) {