diff options
author | NeilBrown <neilb@suse.com> | 2017-01-04 08:51:59 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2017-01-04 10:07:33 -0500 |
commit | 4459743e3daad32e2c2a753ec9982f35ef26a2a3 (patch) | |
tree | 6184ce79b0c40f28e61c4ad261965fd28ccc4e42 | |
parent | c8919e9a2b102e67ef643c44f42aea9e2e9d7b5b (diff) | |
download | nfs-utils-4459743e3daad32e2c2a753ec9982f35ef26a2a3.tar.gz nfs-utils-4459743e3daad32e2c2a753ec9982f35ef26a2a3.tar.xz nfs-utils-4459743e3daad32e2c2a753ec9982f35ef26a2a3.zip |
nfsd: fix setting of minor version from config file
Several problem here:
- code didn't actually work, as it cleared a bit from minorversset
when it should have cleared from minorvers
- code did not allow minor versions to be enabled, which is useful
when a new minor version is partially implemented in the kernel
but not yet enabled by default
- code allowed version 4.0 to be enabled/disabled, which the kernel
does not support (as for 4.9 at least).
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/nfsd/nfsd.c | 16 | ||||
-rw-r--r-- | utils/nfsd/nfsd.man | 6 |
2 files changed, 17 insertions, 5 deletions
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index 3c451aa..eb346f6 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -107,12 +107,24 @@ main(int argc, char **argv) /* We assume the kernel will default all minor versions to 'on', * and allow the config file to disable some. */ - for (i = 0; i <= NFS4_MAXMINOR; i++) { + for (i = NFS4_MINMINOR; i <= NFS4_MAXMINOR; i++) { char tag[20]; sprintf(tag, "vers4.%d", i); + /* The default for minor version support is to let the + * kernel decide. We could ask the kernel what that choice + * will be, but that is needlessly complex. + * Instead, perform a config-file lookup using each of the + * two possible default. If the result is different from the + * default, then impose that value, else don't make a change + * (i.e. don't set the bit in minorversset). + */ if (!conf_get_bool("nfsd", tag, 1)) { NFSCTL_VERSET(minorversset, i); - NFSCTL_VERUNSET(minorversset, i); + NFSCTL_VERUNSET(minorvers, i); + } + if (conf_get_bool("nfsd", tag, 0)) { + NFSCTL_VERSET(minorversset, i); + NFSCTL_VERSET(minorvers, i); } } diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man index 9381cf9..8d198e2 100644 --- a/utils/nfsd/nfsd.man +++ b/utils/nfsd/nfsd.man @@ -161,10 +161,10 @@ by default. .B vers4.1 .TP .B vers4.2 -.TP -.B vers4.3 Setting these to "off" or similar will disable the selected minor -versions. All are enabled by default. +versions. Setting to "on" will enable them. The default values +are determined by the kernel, and usually minor versions default to +being enabled once the implementation is sufficiently complete. .SH NOTES If the program is built with TI-RPC support, it will enable any protocol and |