Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
From: Donald Brady <don.brady@delphix.com>
To: linux-nfs@vger.kernel.org
Subject: nfs-config.service fails to apply no-nfs-version after a reboot
Date: Thu, 11 Jul 2019 14:06:07 -0600
Message-ID: <CAPEr6wVVyU88Km+hWVSv8jQhm2-Z7OV1vQZBr1rtLYeoaYr_ug@mail.gmail.com> (raw)

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

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPEr6wVVyU88Km+hWVSv8jQhm2-Z7OV1vQZBr1rtLYeoaYr_ug@mail.gmail.com \
    --to=don.brady@delphix.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox