Blame SOURCES/autofs-5.1.6-mount_nfs_c-fix-local-rdma-share-not-mounting.patch

1b50e3
autofs-5.1.6 - mount_nfs.c fix local rdma share not mounting
1b50e3
1b50e3
From: Achilles Gaikwad <agaikwad@redhat.com>
1b50e3
1b50e3
When using the same system as nfs-server and nfs-client, and
1b50e3
using `nobind` option for autofs we would fall to the code where
1b50e3
we let `mount.nfs(8)` to handle the mount. However, when the
1b50e3
nfs-server and the nfs-client is the same system we end up calling
1b50e3
`rpc_ping` which gives negative return code. Due to this we fall to
1b50e3
the label next: and never attempt a mount of nfs share.
1b50e3
This patch fixes this BUG by not probing rpc_ping if we're
1b50e3
using rdma.
1b50e3
1b50e3
Signed-off-by: Achilles Gaikwad <agaikwad@redhat.com>
1b50e3
Signed-off-by: Ian Kent <raven@themaw.net>
1b50e3
---
1b50e3
 CHANGELOG           |    1 +
1b50e3
 modules/mount_nfs.c |    9 +++++++--
1b50e3
 2 files changed, 8 insertions(+), 2 deletions(-)
1b50e3
1b50e3
--- autofs-5.1.4.orig/CHANGELOG
1b50e3
+++ autofs-5.1.4/CHANGELOG
1b50e3
@@ -81,6 +81,7 @@ xx/xx/2018 autofs-5.1.5
1b50e3
 - initialize struct addrinfo for getaddrinfo() calls.
1b50e3
 - fix quoted string length calc in expandsunent().
1b50e3
 - fix autofs mount options construction.
1b50e3
+- mount_nfs.c fix local rdma share not mounting.
1b50e3
 
1b50e3
 19/12/2017 autofs-5.1.4
1b50e3
 - fix spec file url.
1b50e3
--- autofs-5.1.4.orig/modules/mount_nfs.c
1b50e3
+++ autofs-5.1.4/modules/mount_nfs.c
1b50e3
@@ -375,9 +375,14 @@ dont_probe:
1b50e3
 		 */
1b50e3
 		if (this->proximity == PROXIMITY_LOCAL) {
1b50e3
 			char *host = this->name ? this->name : "localhost";
1b50e3
-			int ret;
1b50e3
+			int ret = 1;
1b50e3
 
1b50e3
-			ret = rpc_ping(host, port, vers, 2, 0, RPC_CLOSE_DEFAULT);
1b50e3
+			/* If we're using RDMA, rpc_ping will fail when
1b50e3
+			 * nfs-server is local. Therefore, don't probe
1b50e3
+			 * when we're using RDMA.
1b50e3
+			 */
1b50e3
+			if(!rdma)
1b50e3
+				ret = rpc_ping(host, port, vers, 2, 0, RPC_CLOSE_DEFAULT);
1b50e3
 			if (ret <= 0)
1b50e3
 				goto next;
1b50e3
 		}