]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSD: fix nfsd_reset_versions for NFSv4.
authorNeilBrown <neilb@suse.com>
Fri, 10 Mar 2017 00:36:39 +0000 (11:36 +1100)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 17 Jan 2018 17:55:33 +0000 (12:55 -0500)
commit7c6d4318dce23369a144d5ebe9669395ac705e15
tree519cd442508202382c0798b33366907700853b7c
parenta24c04fb2b307be0e0bc4a6e2e12ecacf8e90ed1
NFSD: fix nfsd_reset_versions for NFSv4.

[ Upstream commit 800a938f0bf9130c8256116649c0cc5806bfb2fd ]

If you write "-2 -3 -4" to the "versions" file, it will
notice that no versions are enabled, and nfsd_reset_versions()
is called.
This enables all major versions, not no minor versions.
So we lose the invariant that NFSv4 is only advertised when
at least one minor is enabled.

Fix the code to explicitly enable minor versions for v4,
change it to use nfsd_vers() to test and set, and simplify
the code.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
fs/nfsd/nfssvc.c