[nfs-utils/f19] Added v4.1 support rpc.nfsd (bz 947073)

Steve Dickson steved at fedoraproject.org
Mon Apr 1 15:45:05 UTC 2013


commit 81e20eed7a3272757e37a968e9e1ddd421ea1c6a
Author: Steve Dickson <steved at redhat.com>
Date:   Mon Apr 1 11:30:55 2013 -0400

     Added v4.1 support rpc.nfsd (bz 947073)
    
    Signed-off-by: Steve Dickson <steved at redhat.com>

 nfs-utils-1.2.7-nfsd-v41.patch |  111 ++++++++++++++++++++++++++++++++++++++++
 nfs-utils.spec                 |    7 ++-
 2 files changed, 117 insertions(+), 1 deletions(-)
---
diff --git a/nfs-utils-1.2.7-nfsd-v41.patch b/nfs-utils-1.2.7-nfsd-v41.patch
new file mode 100644
index 0000000..f15ca3d
--- /dev/null
+++ b/nfs-utils-1.2.7-nfsd-v41.patch
@@ -0,0 +1,111 @@
+commit e79baddaa1d8cf24cce929e14f6f91ac0d5e15d0
+Author: Trond Myklebust <Trond.Myklebust at 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 at fieldses.org>
+    Signed-off-by: Trond Myklebust <Trond.Myklebust at netapp.com>
+    Signed-off-by: Steve Dickson <steved at 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
diff --git a/nfs-utils.spec b/nfs-utils.spec
index 275639d..d169a76 100644
--- a/nfs-utils.spec
+++ b/nfs-utils.spec
@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
 Name: nfs-utils
 URL: http://sourceforge.net/projects/nfs
 Version: 1.2.7
-Release: 5%{?dist}
+Release: 6%{?dist}
 Epoch: 1
 
 # group all 32bit related archs
@@ -37,6 +37,7 @@ Source52: nfs-server.postconfig
 %define nfs_configs %{SOURCE50} %{SOURCE51} %{SOURCE52} 
 
 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
 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
 
 %patch001 -p1
+%patch002 -p1
 
 %patch100 -p1
 %patch101 -p1
@@ -298,6 +300,9 @@ fi
 %attr(4755,root,root)   /sbin/umount.nfs4
 
 %changelog
+* Mon Apr  1 2013 Steve Dickson <steved at redhat.com> 1.2.7-6
+- Added v4.1 support rpc.nfsd (bz 947073)
+
 * Mon Mar 25 2013 Steve Dickson <steved at redhat.com> 1.2.7-5
 - 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)


More information about the scm-commits mailing list