Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4959657rwi; Mon, 17 Oct 2022 13:17:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75K1jZ8xRcy0dYCtpek3hHpEtCCHH86HgDITVVtkvPyIPbKaZtXIKpi3fgZpswW3LA444Q X-Received: by 2002:a17:903:1d1:b0:17f:6494:f8c3 with SMTP id e17-20020a17090301d100b0017f6494f8c3mr13554031plh.157.1666037861141; Mon, 17 Oct 2022 13:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666037861; cv=none; d=google.com; s=arc-20160816; b=O25nYoObDa0facruU6QEHh87zMQjbnYVWmdqElr8WPRcOPkZyDQSt/m/LXVDVLRJbL Q+ezXSDV4YwzQ4NY0YeLxyBU9kx08isYmO6DHb8d4yTdhz9FZu/3vDn1Grvt1U0QJ8Ts vZRWANd9A8WuJ5DyhnWLg0FScc/1Fg+96K12OTqrmRwYPt4Xtqy+29hvmisTwCQUvlE6 8yOLolA1yGPDt+oo1VZYihZLR2WLYDcKHuHuUeaRcQvceOYI1ITfoQGjlsnZf72mZ5/E o/k3nz65iu+IjWqqMTPK1q7mWl0EKOdNZZa4zLeJ0sV8NJd3bd0UMwNmzPVepyOO7a2i CUYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iYZE92aaPHURZW/3hIuu6s+LN64K11s62xt0b/EWFXg=; b=V4AP6Xq9KY+gmD38Yj4qj8PvwaBqWcvVEVdv5tLj2o1UWDtoJmZyOoXPepELnu5y6I M71ZwMq1dPgv4xf2R5R99DZODqaq72rXnaTr2HIZzI3SqDdrgQajvZk0AsNGXlHYgbnX vAj/7k4uz7N3uyeU8c9car06ldSVh+ZWiTPMcRh68Xfafdqj15d3t8RaZTUka0MLblRS huP3tyfDu3cfRHjRb0pQprkfDWFp0DQC0hABYzHCjwKWmZ3s2dNjYmT4f0COpaT/brPu diEQ627xjGw4v6L/3XXE7eIsVA9i2UwoLmxhSoeXDWHqVps5v+EV9NVldaQjAV2RvdZz uYWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vFbowPAn; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a630311000000b0043090081d69si12144094pgd.82.2022.10.17.13.17.16; Mon, 17 Oct 2022 13:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vFbowPAn; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231410AbiJQUQg (ORCPT + 99 others); Mon, 17 Oct 2022 16:16:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbiJQUQN (ORCPT ); Mon, 17 Oct 2022 16:16:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB86BFF6 for ; Mon, 17 Oct 2022 13:15:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 044B461261 for ; Mon, 17 Oct 2022 20:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15657C433D6; Mon, 17 Oct 2022 20:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666037678; bh=zyfakENWOdvnyvFObhAlNA4G8UYRTiA9cmNx8xJG3Zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFbowPAn83OpVoLKwi8cowDB6/dsePJgiACXOkLnseP0HfY553bbQcGUJyvGvyDu7 xbzAlSX2Uxxv4ET1LxzHpnx6fHudBsuJjD91Tg1INMPPjx1WohtGXhTeAPxMgDT21r 8WMLaKhR3pYl1xT/8kCD2UwadL4irm7TE6Fb/IDm+DxaguK9CYT/D+tsAXXxvdC/6U trt1hWMFJbyN9tJSXfx6Ba20wB7VD+68hlqPPF2swZezNJDA8aYQGN22IPYysUOQvH OBlmBYUDQJEYWGl/I7LoNXo6S0xC/4QeBDEGPa1YyrIs0F2tg7GTHc+zVUUo/LRijv WM6AJ/yy2+T0A== From: Jeff Layton To: chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 2/2] nfsd: allow disabling NFSv2 at compile time Date: Mon, 17 Oct 2022 16:14:36 -0400 Message-Id: <20221017201436.487627-2-jlayton@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017201436.487627-1-jlayton@kernel.org> References: <20221017201436.487627-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org rpc.nfsd stopped supporting NFSv2 a year ago. Take the next logical step toward deprecating it and allow NFSv2 support to be compiled out. Add a new CONFIG_NFSD_V2 option that can be turned off and rework the CONFIG_NFSD_V?_ACL option dependencies. Add a description that discourages enabling it. Also, change the description of CONFIG_NFSD to state that the always-on version is now 3 instead of 2. Signed-off-by: Jeff Layton --- fs/nfsd/Kconfig | 19 +++++++++++++++---- fs/nfsd/Makefile | 5 +++-- fs/nfsd/nfsd.h | 3 +-- fs/nfsd/nfssvc.c | 6 ++++++ 4 files changed, 25 insertions(+), 8 deletions(-) v2: split out nfserrno move into separate patch add help text to CONFIG_NFSD_V2 Kconfig option don't error out in __write_versions diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig index f6a2fd3015e7..7c441f2bd444 100644 --- a/fs/nfsd/Kconfig +++ b/fs/nfsd/Kconfig @@ -8,6 +8,7 @@ config NFSD select SUNRPC select EXPORTFS select NFS_ACL_SUPPORT if NFSD_V2_ACL + select NFS_ACL_SUPPORT if NFSD_V3_ACL depends on MULTIUSER help Choose Y here if you want to allow other computers to access @@ -26,19 +27,29 @@ config NFSD Below you can choose which versions of the NFS protocol are available to clients mounting the NFS server on this system. - Support for NFS version 2 (RFC 1094) is always available when + Support for NFS version 3 (RFC 1813) is always available when CONFIG_NFSD is selected. If unsure, say N. -config NFSD_V2_ACL - bool +config NFSD_V2 + bool "NFS server support for NFS version 2 (DEPRECATED)" depends on NFSD + default n + help + NFSv2 (RFC 1094) was the first publicly-released version of NFS. + Unless you are hosting ancient (1990's era) NFS clients, you don't + need this. + + If unsure, say N. + +config NFSD_V2_ACL + bool "NFS server support for the NFSv2 ACL protocol extension" + depends on NFSD_V2 config NFSD_V3_ACL bool "NFS server support for the NFSv3 ACL protocol extension" depends on NFSD - select NFSD_V2_ACL help Solaris NFS servers support an auxiliary NFSv3 ACL protocol that never became an official part of the NFS version 3 protocol. diff --git a/fs/nfsd/Makefile b/fs/nfsd/Makefile index 805c06d5f1b4..6fffc8f03f74 100644 --- a/fs/nfsd/Makefile +++ b/fs/nfsd/Makefile @@ -10,9 +10,10 @@ obj-$(CONFIG_NFSD) += nfsd.o # this one should be compiled first, as the tracing macros can easily blow up nfsd-y += trace.o -nfsd-y += nfssvc.o nfsctl.o nfsproc.o nfsfh.o vfs.o \ - export.o auth.o lockd.o nfscache.o nfsxdr.o \ +nfsd-y += nfssvc.o nfsctl.o nfsfh.o vfs.o \ + export.o auth.o lockd.o nfscache.o \ stats.o filecache.o nfs3proc.o nfs3xdr.o +nfsd-$(CONFIG_NFSD_V2) += nfsproc.o nfsxdr.o nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o nfsd-$(CONFIG_NFSD_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4idmap.o \ diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 09726c5b9a31..93b42ef9ed91 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -64,8 +64,7 @@ struct readdir_cd { extern struct svc_program nfsd_program; -extern const struct svc_version nfsd_version2, nfsd_version3, - nfsd_version4; +extern const struct svc_version nfsd_version2, nfsd_version3, nfsd_version4; extern struct mutex nfsd_mutex; extern spinlock_t nfsd_drc_lock; extern unsigned long nfsd_drc_max_mem; diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index bfbd9f672f59..62e473b0ca52 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -91,8 +91,12 @@ unsigned long nfsd_drc_mem_used; #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) static struct svc_stat nfsd_acl_svcstats; static const struct svc_version *nfsd_acl_version[] = { +# if defined(CONFIG_NFSD_V2_ACL) [2] = &nfsd_acl_version2, +# endif +# if defined(CONFIG_NFSD_V3_ACL) [3] = &nfsd_acl_version3, +# endif }; #define NFSD_ACL_MINVERS 2 @@ -116,7 +120,9 @@ static struct svc_stat nfsd_acl_svcstats = { #endif /* defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) */ static const struct svc_version *nfsd_version[] = { +#if defined(CONFIG_NFSD_V2) [2] = &nfsd_version2, +#endif [3] = &nfsd_version3, #if defined(CONFIG_NFSD_V4) [4] = &nfsd_version4, -- 2.37.3