From patchwork Mon Dec 10 09:19:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislav Kinsbursky X-Patchwork-Id: 1856471 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CABB03FCF2 for ; Mon, 10 Dec 2012 09:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753843Ab2LJJSg (ORCPT ); Mon, 10 Dec 2012 04:18:36 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:33986 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820Ab2LJJSe (ORCPT ); Mon, 10 Dec 2012 04:18:34 -0500 Received: from localhost.localdomain ([10.30.21.131]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id qBA9INPq017215; Mon, 10 Dec 2012 13:18:23 +0400 (MSK) Subject: [PATCH 1/7] nfsd: use "init_net" for portmapper To: bfields@fieldses.org From: Stanislav Kinsbursky Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, devel@openvz.org Date: Mon, 10 Dec 2012 12:19:04 +0300 Message-ID: <20121210091904.8855.89077.stgit@localhost.localdomain> In-Reply-To: <20121210091832.8855.26672.stgit@localhost.localdomain> References: <20121210091832.8855.26672.stgit@localhost.localdomain> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 --- fs/nfsd/nfssvc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index b34a67d..9beace6 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) {