Blame SOURCES/autofs-5.1.2-dont-return-until-after-master-map-retry-read.patch

23b4c9
autofs-5.1.2 - don't return until after master map retry read
23b4c9
23b4c9
From: Ian Kent <raven@themaw.net>
23b4c9
23b4c9
The master map read retry needs to be done before returning success
23b4c9
at startup or there can be problems trying to access automount mounts
23b4c9
before they are mounted.
23b4c9
23b4c9
Signed-off-by: Ian Kent <raven@themaw.net>
23b4c9
---
23b4c9
 CHANGELOG          |    1 +
23b4c9
 daemon/automount.c |   31 ++++++++++---------------------
23b4c9
 2 files changed, 11 insertions(+), 21 deletions(-)
23b4c9
23b4c9
--- autofs-5.0.7.orig/CHANGELOG
23b4c9
+++ autofs-5.0.7/CHANGELOG
23b4c9
@@ -211,6 +211,7 @@
23b4c9
 - fix included master map not found return.
23b4c9
 - dont exit on master map read fail timeout.
23b4c9
 - set sane default master read wait timeout.
23b4c9
+- don't return until after master map retry read.
23b4c9
 
23b4c9
 25/07/2012 autofs-5.0.7
23b4c9
 =======================
23b4c9
--- autofs-5.0.7.orig/daemon/automount.c
23b4c9
+++ autofs-5.0.7/daemon/automount.c
23b4c9
@@ -2483,27 +2483,6 @@ int main(int argc, char *argv[])
23b4c9
 
23b4c9
 	master_read = master_read_master(master_list, age, 0);
23b4c9
 	if (!master_read) {
23b4c9
-		if (foreground)
23b4c9
-			logerr("%s: failed to read master map, "
23b4c9
-			       "will retry!",
23b4c9
-			       program);
23b4c9
-		else
23b4c9
-			logerr("%s: failed to read master map, "
23b4c9
-			       "will retry in background!",
23b4c9
-			       program);
23b4c9
-	}
23b4c9
-
23b4c9
-	/*
23b4c9
-	 * Mmm ... reset force unlink umount so we don't also do this
23b4c9
-	 * in future when we receive a HUP signal.
23b4c9
-	 */
23b4c9
-	do_force_unlink = 0;
23b4c9
-
23b4c9
-	st_stat = 0;
23b4c9
-	res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
23b4c9
-	close(start_pipefd[1]);
23b4c9
-
23b4c9
-	if (!master_read) {
23b4c9
 		/*
23b4c9
 		 * Read master map, waiting until it is available, unless
23b4c9
 		 * a signal is received, in which case exit returning an
23b4c9
@@ -2521,6 +2500,16 @@ int main(int argc, char *argv[])
23b4c9
 		}
23b4c9
 	}
23b4c9
 
23b4c9
+	/*
23b4c9
+	 * Mmm ... reset force unlink umount so we don't also do this
23b4c9
+	 * in future when we receive a HUP signal.
23b4c9
+	 */
23b4c9
+	do_force_unlink = 0;
23b4c9
+
23b4c9
+	st_stat = 0;
23b4c9
+	res = write(start_pipefd[1], pst_stat, sizeof(*pst_stat));
23b4c9
+	close(start_pipefd[1]);
23b4c9
+
23b4c9
 	state_mach_thid = pthread_self();
23b4c9
 	statemachine(NULL);
23b4c9