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

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