Blame SOURCES/nfs-utils-1.3.0-mount-remount.patch

851484
diff -up nfs-utils-1.3.0/utils/mount/stropts.c.orig nfs-utils-1.3.0/utils/mount/stropts.c
851484
--- nfs-utils-1.3.0/utils/mount/stropts.c.orig	2014-03-25 11:12:07.000000000 -0400
851484
+++ nfs-utils-1.3.0/utils/mount/stropts.c	2016-04-28 11:18:25.876793000 -0400
851484
@@ -352,13 +352,26 @@ static int nfs_validate_options(struct n
851484
 	if (!nfs_nfs_proto_family(mi->options, &family))
851484
 		return 0;
851484
 
851484
-	hint.ai_family = (int)family;
851484
-	error = getaddrinfo(mi->hostname, NULL, &hint, &mi->address);
851484
-	if (error != 0) {
851484
-		nfs_error(_("%s: Failed to resolve server %s: %s"),
851484
-			progname, mi->hostname, gai_strerror(error));
851484
-		mi->address = NULL;
851484
-		return 0;
851484
+	/*
851484
+	 * A remount is not going to be able to change the server's address,
851484
+	 * nor should we try to resolve another address for the server as we
851484
+	 * may end up with a different address.
851484
+	 */
851484
+	if (mi->flags & MS_REMOUNT) {
851484
+		po_remove_all(mi->options, "addr");
851484
+	} else {
851484
+		hint.ai_family = (int)family;
851484
+		error = getaddrinfo(mi->hostname, NULL, &hint, &mi->address);
851484
+		if (error != 0) {
851484
+			nfs_error(_("%s: Failed to resolve server %s: %s"),
851484
+				progname, mi->hostname, gai_strerror(error));
851484
+			mi->address = NULL;
851484
+			return 0;
851484
+		}
851484
+
851484
+		if (!nfs_append_addr_option(mi->address->ai_addr,
851484
+						mi->address->ai_addrlen, mi->options))
851484
+			return 0;
851484
 	}
851484
 
851484
 	if (!nfs_set_version(mi))
851484
@@ -367,10 +380,6 @@ static int nfs_validate_options(struct n
851484
 	if (!nfs_append_sloppy_option(mi->options))
851484
 		return 0;
851484
 
851484
-	if (!nfs_append_addr_option(mi->address->ai_addr,
851484
-					mi->address->ai_addrlen, mi->options))
851484
-		return 0;
851484
-
851484
 	return 1;
851484
 }
851484