All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mount.nfs: Ignore vers=4
@ 2009-08-30 16:37 Chuck Lever
       [not found] ` <20090830163617.4608.48355.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever @ 2009-08-30 16:37 UTC (permalink / raw)
  To: linux-nfs

Since mount.nfs looks at the vers= option to determine pmap parameters when
negotiating, it throws EINVAL if "4" is specified, even if the kernel
supports vers=4 for "nfs" type file systems.

Teach mount.nfs to ignore vers=4 and just pass the options to the kernel.

Also fix up umount.nfs to skip the UMNT call for vers=4 mounts.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/network.c   |   12 ++++++++----
 utils/mount/nfsumount.c |    4 ++++
 utils/mount/stropts.c   |    6 ++++++
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index f6fa5fd..420e15a 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -90,6 +90,7 @@ static const char *nfs_transport_opttbl[] = {
 static const char *nfs_version_opttbl[] = {
 	"v2",
 	"v3",
+	"v4",
 	"vers",
 	"nfsvers",
 	NULL,
@@ -1215,10 +1216,13 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
 	case 1: /* v3 */
 		*version = 3;
 		return 1;
-	case 2:	/* vers */
+	case 2: /* v4 */
+		*version = 4;
+		return 1;
+	case 3:	/* vers */
 		switch (po_get_numeric(options, "vers", &tmp)) {
 		case PO_FOUND:
-			if (tmp >= 2 && tmp <= 3) {
+			if (tmp >= 2 && tmp <= 4) {
 				*version = tmp;
 				return 1;
 			}
@@ -1229,10 +1233,10 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
 		case PO_BAD_VALUE:
 			return 0;
 		}
-	case 3: /* nfsvers */
+	case 4: /* nfsvers */
 		switch (po_get_numeric(options, "nfsvers", &tmp)) {
 		case PO_FOUND:
-			if (tmp >= 2 && tmp <= 3) {
+			if (tmp >= 2 && tmp <= 4) {
 				*version = tmp;
 				return 1;
 			}
diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c
index f81db14..c5505b1 100644
--- a/utils/mount/nfsumount.c
+++ b/utils/mount/nfsumount.c
@@ -179,6 +179,10 @@ static int nfs_umount_do_umnt(struct mount_options *options,
 		return EX_FAIL;
 	}
 
+	/* Skip UMNT call for vers=4 mounts */
+	if (nfs_pmap.pm_vers == 4)
+		return EX_SUCCESS;
+
 	*hostname = nfs_umount_hostname(options, *hostname);
 	if (!*hostname) {
 		nfs_error(_("%s: out of memory"), progname);
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index a12ace7..3e88c85 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -438,6 +438,7 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
 	/*
 	 * Extract just the options needed to contact server.
 	 * Bail now if any of these have bad values.
+	 * Skip probing the server if this is a vers=4 mount
 	 */
 	if (!nfs_extract_server_addresses(options, nfs_saddr, &nfs_salen,
 						mnt_saddr, &mnt_salen)) {
@@ -448,6 +449,11 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
 		errno = EINVAL;
 		return 0;
 	}
+	if (nfs_pmap.pm_vers == 4) {
+		if (!nfs_append_clientaddr_option(nfs_saddr, nfs_salen, options))
+			errno = EINVAL;
+		goto out;
+	}
 
 	/*
 	 * The kernel NFS client doesn't support changing the RPC


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-31 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-30 16:37 [PATCH] mount.nfs: Ignore vers=4 Chuck Lever
     [not found] ` <20090830163617.4608.48355.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-08-31 12:44   ` Steve Dickson
     [not found]     ` <4A9BC593.4070405-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-08-31 18:20       ` Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.