Blame SOURCES/nfs-utils-1.3.0-mount-explicit-rback.patch

fc3648
diff -up nfs-utils-1.3.0/utils/mount/stropts.c.orig nfs-utils-1.3.0/utils/mount/stropts.c
fc3648
--- nfs-utils-1.3.0/utils/mount/stropts.c.orig	2017-06-01 11:24:19.925018714 -0400
fc3648
+++ nfs-utils-1.3.0/utils/mount/stropts.c	2017-06-01 11:25:20.033023121 -0400
fc3648
@@ -313,9 +313,10 @@ static int nfs_set_version(struct nfsmou
fc3648
 	if (!nfs_nfs_version(mi->options, &mi->version))
fc3648
 		return 0;
fc3648
 
fc3648
-	if (strncmp(mi->type, "nfs4", 4) == 0)
fc3648
+	if (strncmp(mi->type, "nfs4", 4) == 0) {
fc3648
 		mi->version.major = 4;
fc3648
-
fc3648
+		mi->version.v_mode = V_GENERAL;
fc3648
+	}
fc3648
 	/*
fc3648
 	 * Before 2.6.32, the kernel NFS client didn't
fc3648
 	 * support "-t nfs vers=4" mounts, so NFS version
fc3648
@@ -856,9 +857,6 @@ check_result:
fc3648
 	case EINVAL:
fc3648
 		/* A less clear indication that our client
fc3648
 		 * does not support NFSv4 minor version. */
fc3648
-		if (mi->version.v_mode == V_GENERAL &&
fc3648
-			mi->version.minor == 0)
fc3648
-				return result;
fc3648
 		if (mi->version.v_mode != V_SPECIFIC) {
fc3648
 			if (mi->version.minor > 0) {
fc3648
 				mi->version.minor--;
fc3648
@@ -880,6 +878,9 @@ check_result:
fc3648
 		/* UDP-Only servers won't support v4, but maybe it
fc3648
 		 * just isn't ready yet.  So try v3, but double-check
fc3648
 		 * with rpcbind for v4. */
fc3648
+		if (mi->version.v_mode == V_GENERAL)
fc3648
+			/* Mustn't try v2,v3 */
fc3648
+			return result;
fc3648
 		result = nfs_try_mount_v3v2(mi, TRUE);
fc3648
 		if (result == 0 && errno == EAGAIN) {
fc3648
 			/* v4 server seems to be registered now. */
fc3648
@@ -893,6 +894,9 @@ check_result:
fc3648
 	}
fc3648
 
fc3648
 fall_back:
fc3648
+	if (mi->version.v_mode == V_GENERAL)
fc3648
+		/* v2,3 fallback not allowed */
fc3648
+		return result;
fc3648
 	return nfs_try_mount_v3v2(mi, FALSE);
fc3648
 }
fc3648