Blame SOURCES/nfs-utils-1.3.0-mount-v4arg-fix.patch

64c563
diff -up nfs-utils-1.3.0/utils/mount/stropts.c.orig nfs-utils-1.3.0/utils/mount/stropts.c
64c563
--- nfs-utils-1.3.0/utils/mount/stropts.c.orig	2016-12-18 10:59:32.526389233 -0500
64c563
+++ nfs-utils-1.3.0/utils/mount/stropts.c	2016-12-18 11:02:17.564900647 -0500
64c563
@@ -108,12 +108,6 @@ static void nfs_default_version(struct n
64c563
 		return;
64c563
 	}
64c563
 
64c563
-	if (mi->version.v_mode == V_GENERAL &&
64c563
-		config_default_vers.v_mode == V_DEFAULT) {
64c563
-		mi->version.v_mode = V_SPECIFIC;
64c563
-		return;
64c563
-	}
64c563
-
64c563
 	if (mi->version.v_mode == V_DEFAULT &&
64c563
 		config_default_vers.v_mode != V_DEFAULT) {
64c563
 		mi->version.major = config_default_vers.major;
64c563
@@ -121,9 +115,9 @@ static void nfs_default_version(struct n
64c563
 		return;
64c563
 	}
64c563
 
64c563
-	if (mi->version.v_mode == V_GENERAL &&
64c563
-		config_default_vers.v_mode != V_DEFAULT) {
64c563
-		if (mi->version.major == config_default_vers.major)
64c563
+	if (mi->version.v_mode == V_GENERAL) {
64c563
+		if (config_default_vers.v_mode != V_DEFAULT &&
64c563
+		    mi->version.major == config_default_vers.major)
64c563
 			mi->version.minor = config_default_vers.minor;
64c563
 		return;
64c563
 	}
64c563
@@ -751,8 +745,13 @@ static int nfs_do_mount_v4(struct nfsmou
64c563
 	}
64c563
 
64c563
 	if (mi->version.v_mode != V_SPECIFIC) {
64c563
-		snprintf(version_opt, sizeof(version_opt) - 1,
64c563
-			"vers=%lu.%lu", mi->version.major, mi->version.minor);
64c563
+		if (mi->version.v_mode == V_GENERAL)
64c563
+			snprintf(version_opt, sizeof(version_opt) - 1,
64c563
+				"vers=%lu", mi->version.major);
64c563
+		else
64c563
+			snprintf(version_opt, sizeof(version_opt) - 1,
64c563
+				"vers=%lu.%lu", mi->version.major,
64c563
+				mi->version.minor);
64c563
 
64c563
 		if (po_append(options, version_opt) == PO_FAILED) {
64c563
 			errno = EINVAL;