Blame SOURCES/nfs-utils-2.3.3-mount-fallback.patch

d4362b
commit a709f25c1da4a2fb44a1f3fd060298fbbd88aa3c
d4362b
Author: Steve Dickson <steved@redhat.com>
d4362b
Date:   Tue May 14 15:52:50 2019 -0400
d4362b
d4362b
    mount: Report correct error in the fall_back cases.
d4362b
    
d4362b
    In mount auto negotiation, a v3 mount is tried
d4362b
    when the v4 fails with error that could mean
d4362b
    v4 is not supported.
d4362b
    
d4362b
    When the v3 mount fails, the original v4 failure
d4362b
    should be used to set the errno, not the v3 failure.
d4362b
    
d4362b
    Fixes:https://bugzilla.redhat.com/show_bug.cgi?id=1709961
d4362b
    Signed-off-by: Steve Dickson <steved@redhat.com>
d4362b
d4362b
diff -up nfs-utils-2.3.3/utils/mount/stropts.c.orig nfs-utils-2.3.3/utils/mount/stropts.c
d4362b
--- nfs-utils-2.3.3/utils/mount/stropts.c.orig	2019-08-12 10:58:32.610650773 -0400
d4362b
+++ nfs-utils-2.3.3/utils/mount/stropts.c	2019-08-12 11:10:39.661142985 -0400
d4362b
@@ -888,7 +888,7 @@ out:
d4362b
  */
d4362b
 static int nfs_autonegotiate(struct nfsmount_info *mi)
d4362b
 {
d4362b
-	int result;
d4362b
+	int result, olderrno;
d4362b
 
d4362b
 	result = nfs_try_mount_v4(mi);
d4362b
 check_result:
d4362b
@@ -948,7 +948,18 @@ fall_back:
d4362b
 	if (mi->version.v_mode == V_GENERAL)
d4362b
 		/* v2,3 fallback not allowed */
d4362b
 		return result;
d4362b
-	return nfs_try_mount_v3v2(mi, FALSE);
d4362b
+
d4362b
+	/*
d4362b
+	 * Save the original errno in case the v3 
d4362b
+	 * mount fails from one of the fall_back cases. 
d4362b
+	 * Report the first failure not the v3 mount failure
d4362b
+	 */
d4362b
+	olderrno = errno;
d4362b
+	if ((result = nfs_try_mount_v3v2(mi, FALSE)))
d4362b
+		return result;
d4362b
+
d4362b
+	errno = olderrno;
d4362b
+	return result;
d4362b
 }
d4362b
 
d4362b
 /*