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