Ian Kent cb15d2
autofs-5.0.7 - dont probe rdma mounts
Ian Kent cb15d2
Ian Kent cb15d2
From: Ian Kent <raven@themaw.net>
Ian Kent cb15d2
Ian Kent cb15d2
Since the change to pass text nfs mount options drectly to the kernel all autofs
Ian Kent cb15d2
mount requests now probe server availability. This was because of long delays
Ian Kent cb15d2
mounting from servers that aren't responding.
Ian Kent cb15d2
Ian Kent cb15d2
This caused mounts requesting the rdma protocol to fail if udp or tcp was also
Ian Kent cb15d2
not available from the server.
Ian Kent cb15d2
Ian Kent cb15d2
Since, AFAICT the rmda protocol can't be used with RPC fromn userspace, the only
Ian Kent cb15d2
way to work around it is to not probe servers when rdma is requested.
Ian Kent cb15d2
---
Ian Kent cb15d2
 CHANGELOG           |    1 +
Ian Kent cb15d2
 modules/mount_nfs.c |   13 ++++++++++++-
Ian Kent cb15d2
 2 files changed, 13 insertions(+), 1 deletion(-)
Ian Kent cb15d2
Ian Kent cb15d2
diff --git a/CHANGELOG b/CHANGELOG
Ian Kent cb15d2
index 50e83d7..f9bc987 100644
Ian Kent cb15d2
--- a/CHANGELOG
Ian Kent cb15d2
+++ b/CHANGELOG
Ian Kent cb15d2
@@ -44,6 +44,7 @@
Ian Kent cb15d2
 - document allowed map sources in auto.master.
Ian Kent cb15d2
 - add enable sloppy mount option to configure.
Ian Kent cb15d2
 - fix interface address null check.
Ian Kent cb15d2
+- dont probe rdma mounts.
Ian Kent cb15d2
 
Ian Kent cb15d2
 25/07/2012 autofs-5.0.7
Ian Kent cb15d2
 =======================
Ian Kent cb15d2
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
Ian Kent cb15d2
index e61320b..5424d74 100644
Ian Kent cb15d2
--- a/modules/mount_nfs.c
Ian Kent cb15d2
+++ b/modules/mount_nfs.c
Ian Kent cb15d2
@@ -71,6 +71,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
Ian Kent cb15d2
 	int nosymlink = 0;
Ian Kent cb15d2
 	int port = -1;
Ian Kent cb15d2
 	int ro = 0;            /* Set if mount bind should be read-only */
Ian Kent cb15d2
+	int rdma = 0;
Ian Kent cb15d2
 
Ian Kent cb15d2
 	if (ap->flags & MOUNT_FLAG_REMOUNT)
Ian Kent cb15d2
 		return 0;
Ian Kent cb15d2
@@ -124,6 +125,11 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
Ian Kent cb15d2
 				end--;
Ian Kent cb15d2
 
Ian Kent cb15d2
 			o_len = end - cp + 1;
Ian Kent cb15d2
+
Ian Kent cb15d2
+			if (strncmp("proto=rdma", cp, o_len) == 0 ||
Ian Kent cb15d2
+				   strncmp("rdma", cp, o_len) == 0)
Ian Kent cb15d2
+				rdma = 1;
Ian Kent cb15d2
+
Ian Kent cb15d2
 			if (strncmp("nosymlink", cp, o_len) == 0) {
Ian Kent cb15d2
 				warn(ap->logopt, MODPREFIX
Ian Kent cb15d2
 				     "the \"nosymlink\" option is depricated "
Ian Kent cb15d2
@@ -170,7 +176,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
Ian Kent cb15d2
 		info(ap->logopt, MODPREFIX "no hosts available");
Ian Kent cb15d2
 		return 1;
Ian Kent cb15d2
 	}
Ian Kent cb15d2
-	prune_host_list(ap->logopt, &hosts, vers, port);
Ian Kent cb15d2
+	/*
Ian Kent cb15d2
+	 * We can't probe protocol rdma so leave it to mount.nfs(8)
Ian Kent cb15d2
+	 * and and suffer the delay if a server isn't available.
Ian Kent cb15d2
+	 */
Ian Kent cb15d2
+	if (!rdma)
Ian Kent cb15d2
+		prune_host_list(ap->logopt, &hosts, vers, port);
Ian Kent cb15d2
 
Ian Kent cb15d2
 	if (!hosts) {
Ian Kent cb15d2
 		info(ap->logopt, MODPREFIX "no hosts available");