diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2011-09-20 07:40:15 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2011-09-20 07:41:36 -0400 |
commit | fe34ff0312c7c22554087ecd78bbbeadb38ce195 (patch) | |
tree | f8c8690404b011c812696cce5b79bdfad4b5cd99 /utils/nfsd/nfsd.c | |
parent | 10e9c07a18d7c8635def61ea19adbc47f2934853 (diff) | |
download | nfs-utils-fe34ff0312c7c22554087ecd78bbbeadb38ce195.tar.gz nfs-utils-fe34ff0312c7c22554087ecd78bbbeadb38ce195.tar.xz nfs-utils-fe34ff0312c7c22554087ecd78bbbeadb38ce195.zip |
nfsd: allow choosing server 41 support at runtime
In the case where -N 4.1 is left off the commandline, the current code
explicitly turns it on or off anyway, depending on configure options.
Instead, just leave 4.1 support alone. This allows a user to add an
"echo +4.1 >/proc/fs/nfsd/versions" to their init scripts, if they want.
Otherwise they will get the kernel's default (currently to leave 4.1
off, as long as 4.1 support is experimental).
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/nfsd/nfsd.c')
-rw-r--r-- | utils/nfsd/nfsd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index e7e1470..8bc5d3a 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -94,7 +94,7 @@ main(int argc, char **argv) char *p, *progname, *port; char *haddr = NULL; int socket_up = 0; - int minorvers4 = NFSD_MAXMINORVERS4; /* nfsv4 minor version */ + int minorvers41 = 0; /* nfsv4 minor version */ unsigned int versbits = NFSCTL_ALLBITS; unsigned int protobits = NFSCTL_ALLBITS; unsigned int proto4 = 0; @@ -154,7 +154,12 @@ main(int argc, char **argv) switch((c = strtol(optarg, &p, 0))) { case 4: if (*p == '.') { - minorvers4 = -atoi(p + 1); + int i = atoi(p+1); + if (i != 1) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } + minorvers41 = -1; break; } case 3: @@ -251,7 +256,7 @@ main(int argc, char **argv) * registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ - nfssvc_setvers(versbits, minorvers4); + nfssvc_setvers(versbits, minorvers41); error = nfssvc_set_sockets(AF_INET, proto4, haddr, port); if (!error) |