0bbe35
diff -up nfs-utils-1.3.0/utils/mount/stropts.c.orig nfs-utils-1.3.0/utils/mount/stropts.c
0bbe35
--- nfs-utils-1.3.0/utils/mount/stropts.c.orig	2020-04-24 11:20:59.576467216 -0400
0bbe35
+++ nfs-utils-1.3.0/utils/mount/stropts.c	2020-04-24 11:36:56.482047489 -0400
0bbe35
@@ -851,7 +851,7 @@ out:
0bbe35
  */
0bbe35
 static int nfs_autonegotiate(struct nfsmount_info *mi)
0bbe35
 {
0bbe35
-	int result;
0bbe35
+	int result, olderrno;
0bbe35
 
0bbe35
 	result = nfs_try_mount_v4(mi);
0bbe35
 check_result:
0bbe35
@@ -911,7 +911,18 @@ fall_back:
0bbe35
 	if (mi->version.v_mode == V_GENERAL)
0bbe35
 		/* v2,3 fallback not allowed */
0bbe35
 		return result;
0bbe35
-	return nfs_try_mount_v3v2(mi, FALSE);
0bbe35
+
0bbe35
+	/*
0bbe35
+	 * Save the original errno in case the v3 
0bbe35
+	 * mount fails from one of the fall_back cases. 
0bbe35
+	 * Report the first failure not the v3 mount failure
0bbe35
+	 */
0bbe35
+	olderrno = errno;
0bbe35
+	if ((result = nfs_try_mount_v3v2(mi, FALSE)))
0bbe35
+		return result;
0bbe35
+
0bbe35
+	errno = olderrno;
0bbe35
+	return result;
0bbe35
 }
0bbe35
 
0bbe35
 /*