Added v4.1 support rpc.nfsd (bz 947073)

Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
Steve Dickson 2013-04-01 11:30:55 -04:00
parent 446b32aaf5
commit a2169b1760
2 changed files with 117 additions and 1 deletions

View File

@ -0,0 +1,111 @@
commit e79baddaa1d8cf24cce929e14f6f91ac0d5e15d0
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Mon Mar 25 16:07:59 2013 -0400
nfsd: Add support for the -V and --nfs-version optional arguments
Add command line options to enable those NFS versions that are
currently disabled by default. We choose to use the options '-V'
and '--nfs-version' for compatibility with rpc.mountd.
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/support/include/nfs/nfs.h b/support/include/nfs/nfs.h
index 320880e..174c2dd 100644
--- a/support/include/nfs/nfs.h
+++ b/support/include/nfs/nfs.h
@@ -52,6 +52,7 @@ struct nfs_fh_old {
#define NFSCTL_UDPISSET(_cltbits) ((_cltbits) & NFSCTL_UDPBIT)
#define NFSCTL_TCPISSET(_cltbits) ((_cltbits) & NFSCTL_TCPBIT)
+#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << ((_v) - 1)))
#define NFSCTL_UDPSET(_cltbits) ((_cltbits) |= NFSCTL_UDPBIT)
#define NFSCTL_TCPSET(_cltbits) ((_cltbits) |= NFSCTL_TCPBIT)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index 2a3f5cc..e87c0a9 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -38,6 +38,7 @@ static struct option longopts[] =
{ "host", 1, 0, 'H' },
{ "help", 0, 0, 'h' },
{ "no-nfs-version", 1, 0, 'N' },
+ { "nfs-version", 1, 0, 'V' },
{ "no-tcp", 0, 0, 'T' },
{ "no-udp", 0, 0, 'U' },
{ "port", 1, 0, 'P' },
@@ -119,7 +120,7 @@ main(int argc, char **argv)
xlog_syslog(0);
xlog_stderr(1);
- while ((c = getopt_long(argc, argv, "dH:hN:p:P:sTU", longopts, NULL)) != EOF) {
+ while ((c = getopt_long(argc, argv, "dH:hN:V:p:P:sTU", longopts, NULL)) != EOF) {
switch(c) {
case 'd':
xlog_config(D_ALL, 1);
@@ -175,6 +176,27 @@ main(int argc, char **argv)
exit(1);
}
break;
+ case 'V':
+ switch((c = strtol(optarg, &p, 0))) {
+ case 4:
+ if (*p == '.') {
+ int i = atoi(p+1);
+ if (i != 1) {
+ fprintf(stderr, "%s: unsupported minor version\n", optarg);
+ exit(1);
+ }
+ minorvers41 = 1;
+ break;
+ }
+ case 3:
+ case 2:
+ NFSCTL_VERSET(versbits, c);
+ break;
+ default:
+ fprintf(stderr, "%s: Unsupported version\n", optarg);
+ exit(1);
+ }
+ break;
case 's':
xlog_syslog(1);
xlog_stderr(0);
@@ -312,7 +334,7 @@ static void
usage(const char *prog)
{
fprintf(stderr, "Usage:\n"
- "%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version ] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] nrservs\n",
+ "%s [-d|--debug] [-H hostname] [-p|-P|--port port] [-N|--no-nfs-version version] [-V|--nfs-version version] [-s|--syslog] [-T|--no-tcp] [-U|--no-udp] nrservs\n",
prog);
exit(2);
}
diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man
index 1cf9296..7de0867 100644
--- a/utils/nfsd/nfsd.man
+++ b/utils/nfsd/nfsd.man
@@ -47,7 +47,7 @@ This option can be used to request that
.B rpc.nfsd
does not offer certain versions of NFS. The current version of
.B rpc.nfsd
-can support both NFS version 2,3 and the newer version 4.
+can support NFS versions 2,3,4 and the newer version 4.1.
.TP
.B \-s " or " \-\-syslog
By default,
@@ -67,6 +67,13 @@ Disable
.B rpc.nfsd
from accepting UDP connections from clients.
.TP
+.B \-V " or " \-\-nfs-version vers
+This option can be used to request that
+.B rpc.nfsd
+offer certain versions of NFS. The current version of
+.B rpc.nfsd
+can support NFS versions 2,3,4 and the newer version 4.1.
+.TP
.I nproc
specify the number of NFS server threads. By default, just one
thread is started. However, for optimum performance several threads

View File

@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
Name: nfs-utils Name: nfs-utils
URL: http://sourceforge.net/projects/nfs URL: http://sourceforge.net/projects/nfs
Version: 1.2.7 Version: 1.2.7
Release: 5%{?dist} Release: 6%{?dist}
Epoch: 1 Epoch: 1
# group all 32bit related archs # group all 32bit related archs
@ -37,6 +37,7 @@ Source52: nfs-server.postconfig
%define nfs_configs %{SOURCE50} %{SOURCE51} %{SOURCE52} %define nfs_configs %{SOURCE50} %{SOURCE51} %{SOURCE52}
Patch001: nfs-utils.1.2.8.rc4.patch Patch001: nfs-utils.1.2.8.rc4.patch
Patch002: nfs-utils-1.2.7-nfsd-v41.patch
Patch100: nfs-utils-1.2.1-statdpath-man.patch Patch100: nfs-utils-1.2.1-statdpath-man.patch
Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch
@ -94,6 +95,7 @@ This package also contains the mount.nfs and umount.nfs program.
%setup -q %setup -q
%patch001 -p1 %patch001 -p1
%patch002 -p1
%patch100 -p1 %patch100 -p1
%patch101 -p1 %patch101 -p1
@ -298,6 +300,9 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4 %attr(4755,root,root) /sbin/umount.nfs4
%changelog %changelog
* Mon Apr 1 2013 Steve Dickson <steved@redhat.com> 1.2.7-6
- Added v4.1 support rpc.nfsd (bz 947073)
* Mon Mar 25 2013 Steve Dickson <steved@redhat.com> 1.2.7-5 * Mon Mar 25 2013 Steve Dickson <steved@redhat.com> 1.2.7-5
- Updated to latest upstream RC release: nfs-utils.1.2.8-rc4 - Updated to latest upstream RC release: nfs-utils.1.2.8-rc4
- Added nfs-lock.service to After line in nfs-server.service (bz 914792) - Added nfs-lock.service to After line in nfs-server.service (bz 914792)