Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 21

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs-5.0.1 - check replicated list after probe

From: Ian Kent <raven@themaw.net>

When checking a list of servers for proximity and NFS version
the list may become empty after after the initial probe. This
case isn't handled and this patch adds it.
---

 modules/replicated.c |    9 +++++++++
 1 file changed, 9 insertions(+)


--- autofs-5.0.1.orig/modules/replicated.c
+++ autofs-5.0.1/modules/replicated.c
@@ -758,6 +758,15 @@ int prune_host_list(unsigned logopt, str
 		this = next;
 	}
 
+	/*
+	 * The list of hosts that aren't proximity local may now
+	 * be empty if we haven't been able probe any so we need
+	 * to check again for a list containing only proximity
+	 * local hosts.
+	 */
+	if (!first)
+		return 1;
+
 	last = this;
 
 	/* Select NFS version of highest number of closest servers */