mbox series

[RFC,0/3] Remove NFS v2 support from the client and server

Message ID 20211129192731.783466-1-steved@redhat.com (mailing list archive)
Headers show
Series Remove NFS v2 support from the client and server | expand

Message

Steve Dickson Nov. 29, 2021, 7:27 p.m. UTC
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). I looked at creating 
a kernel parameter module so support could re-enabled 
but that got ugly quick.

So I just decided to make all V2 mounts fail with
EOPNOTSUPP, with no way of turn them back on.

Steve Dickson (3):
  nfsd: Remove the ability to enable NFS v2.
  nfs.man: Remove references to NFS v2 from the man pages
  mount: Remove NFS v2 support from mount.nfs

 nfs.conf                  |  1 -
 utils/mount/configfile.c  |  2 +-
 utils/mount/mount.nfs.man |  2 +-
 utils/mount/network.c     |  4 ++--
 utils/mount/nfs.man       | 20 +++-----------------
 utils/mount/nfsmount.conf |  2 +-
 utils/mount/stropts.c     |  3 +++
 utils/nfsd/nfsd.c         |  2 --
 utils/nfsd/nfsd.man       |  4 ++--
 9 files changed, 13 insertions(+), 27 deletions(-)

Comments

NeilBrown Nov. 29, 2021, 8:38 p.m. UTC | #1
On Tue, 30 Nov 2021, Steve Dickson wrote:
> These patches will remove the all references and 
> support of NFS v2 in both the server and client.

What is the motivation for this?
I don't necessarily disagree, but I'm curious as to what you hope to
gain.

Thanks,
NeilBrown

> 
> 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). I looked at creating 
> a kernel parameter module so support could re-enabled 
> but that got ugly quick.
> 
> So I just decided to make all V2 mounts fail with
> EOPNOTSUPP, with no way of turn them back on.
> 
> Steve Dickson (3):
>   nfsd: Remove the ability to enable NFS v2.
>   nfs.man: Remove references to NFS v2 from the man pages
>   mount: Remove NFS v2 support from mount.nfs
> 
>  nfs.conf                  |  1 -
>  utils/mount/configfile.c  |  2 +-
>  utils/mount/mount.nfs.man |  2 +-
>  utils/mount/network.c     |  4 ++--
>  utils/mount/nfs.man       | 20 +++-----------------
>  utils/mount/nfsmount.conf |  2 +-
>  utils/mount/stropts.c     |  3 +++
>  utils/nfsd/nfsd.c         |  2 --
>  utils/nfsd/nfsd.man       |  4 ++--
>  9 files changed, 13 insertions(+), 27 deletions(-)
> 
> -- 
> 2.31.1
> 
>
Steve Dickson Nov. 29, 2021, 9:13 p.m. UTC | #2
Hey!

On 11/29/21 15:38, NeilBrown wrote:
> On Tue, 30 Nov 2021, Steve Dickson wrote:
>> These patches will remove the all references and
>> support of NFS v2 in both the server and client.
> 
> What is the motivation for this?
> I don't necessarily disagree, but I'm curious as to what you hope to
> gain.
Just to eliminate v2 support once and for all...
It is a dead version, IMHO, so I'm just trying
to clean things up by remove it from the man pages
and error out (on the client), if a v2 mount is tried...

We are coming out with a major fairly soon, so
I'm just trying make it clear v2 is no longer
an option... So I wanted to more eyes on what
we are thinking of doing.

steved.

> 
> Thanks,
> NeilBrown
> 
>>
>> 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). I looked at creating
>> a kernel parameter module so support could re-enabled
>> but that got ugly quick.
>>
>> So I just decided to make all V2 mounts fail with
>> EOPNOTSUPP, with no way of turn them back on.
>>
>> Steve Dickson (3):
>>    nfsd: Remove the ability to enable NFS v2.
>>    nfs.man: Remove references to NFS v2 from the man pages
>>    mount: Remove NFS v2 support from mount.nfs
>>
>>   nfs.conf                  |  1 -
>>   utils/mount/configfile.c  |  2 +-
>>   utils/mount/mount.nfs.man |  2 +-
>>   utils/mount/network.c     |  4 ++--
>>   utils/mount/nfs.man       | 20 +++-----------------
>>   utils/mount/nfsmount.conf |  2 +-
>>   utils/mount/stropts.c     |  3 +++
>>   utils/nfsd/nfsd.c         |  2 --
>>   utils/nfsd/nfsd.man       |  4 ++--
>>   9 files changed, 13 insertions(+), 27 deletions(-)
>>
>> -- 
>> 2.31.1
>>
>>
>
J. Bruce Fields Nov. 29, 2021, 10:40 p.m. UTC | #3
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