linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* nfs-config.service fails to apply no-nfs-version after a reboot
@ 2019-07-11 20:06 Donald Brady
  0 siblings, 0 replies; only message in thread
From: Donald Brady @ 2019-07-11 20:06 UTC (permalink / raw)
  To: linux-nfs

NFSv4 bug: nfs-config.service fails to apply --no-nfs-version after a reboot

Server kernel version: 4.15.0-1043
Distribution: Ubuntu 18.04.2 LTS
nfs-utils version: 1:1.3.4-2.1ubuntu5.2

Summary
There are various configuration options for the nfs server that reside
in '/etc/default/nfs-kernel-server'.  To disable NFS versions 4.1 and
4.2, you can specify:

RPCNFSDOPTS="--no-nfs-version 4.1 --no-nfs-version 4.2"

The nfs-config.service consumes the above RPCNFSDOPTS and creates
RPCNFSDARGS that the nfs-server.service will pass to rpc.nfsd(8) for
its ExecStart (see results below).

$ cat /var/run/sysconfig/nfs-utils
PIPEFS_MOUNTPOINT=/run/rpc_pipefs
RPCNFSDARGS="--no-nfs-version 4.1 --no-nfs-version 4.2 64"
RPCMOUNTDARGS=""
STATDARGS=""
RPCSVCGSSDARGS=""
SVCGSSDARGS=""

In turn, rpc.nfsd  parses the version info from RPCNFSDARGS and writes
it as  "-4.1 -4.2 -2 +3 +4" to '/proc/fs/nfsd/versions'

However, after a reboot, the initial state of versions is "-2 -3 -4
-4.0 -4.1 -4.2" (i.e. nothing is yet enabled) so the kernel ignores
the '-4.1' and '-4.2' since it thinks 4 is not enabled.
See https://elixir.bootlin.com/linux/v4.15/source/fs/nfsd/nfsctl.c#L608

Note that if rpc.nfsd had written versions as "+3 +4 -4.1 -4.2 -2"
then the attempt to remove 4.1 and 4.2 would have succeed.

As a work-around you can write '+4' to `/proc/fs/nfsd/versions` after
a reboot before the nfs-server.service runs rpc.nfsd

Thanks,
Don

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-11 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 20:06 nfs-config.service fails to apply no-nfs-version after a reboot Donald Brady

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).