Re: [PATCH RFC 0/3] Remove NFS v2 support from the client and server

J. Bruce Fields
2021-11-29T23:11:02Z

On Mon, Nov 29, 2021 at 02:27:28PM -0500, Steve Dickson wrote:
> These patches will remove the all references and
> support of NFS v2 in both the server and client.
>
> On server side the support has been off, by default,
> since 2013 (6b4e4965a6b). With this server patch the
> ability to enable v2 will be remove.
>
> Currently even with CONFIG_NFS_V2 not set
> v2 mounts are still tied (over-the-wire).

So the client is running a kernel built with CONFIG_NFS_V2 not set, and
you're still seeing it send NFSv2 calls?

That's very weird.

> I looked at creating a kernel parameter module so support could
> re-enabled but that got ugly quick.

I don't think there's much point to a module parameter.

One other thing we might want to do is provide a way for distros to
configure out support on the server side too. That'd help confirm that
people really aren't using it before we tear it out completely.

E.g., untested, and should probably remove more than this, but as a
start:

diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index 3d1d17256a91..7b9e9afc5fcb 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -35,6 +35,16 @@ config NFSD_V2_ACL
bool
depends on NFSD

+config NFSD_V2
+ bool "NFS server support for NFS version 2"
+ depends on NFSD
+ help
+ This option enables server support for version 2 of the NFS
+ protocol. This version has significant limitations and is no
+ longer widely used.
+
+ If unsure, say N.
+
config NFSD_V3
bool "NFS server support for NFS version 3"
depends on NFSD
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 80431921e5d7..09c376063ff0 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -116,7 +116,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
#if defined(CONFIG_NFSD_V3)
[3] = &nfsd_version3,
#endif