NFSD: fix nfsd_reset_versions for NFSv4.
authorNeilBrown <neilb@suse.com>
Fri, 10 Mar 2017 00:36:39 +0000 (11:36 +1100)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 10 Mar 2017 22:04:50 +0000 (17:04 -0500)
commit800a938f0bf9130c8256116649c0cc5806bfb2fd
tree6c490aba399eaf0db00f939de56519f20c8363c6
parent928c6fb3a9bfd6c5b287aa3465226add551c13c0
NFSD: fix nfsd_reset_versions for NFSv4.

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>
fs/nfsd/nfssvc.c