Blame SOURCES/autofs-5.1.2-handle-amd-cache-option-all-in-amd-type-auto-mounts.patch

304803
autofs-5.1.2 - handle amd cache option all in amd type auto mounts
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
In order to read in the map at mount time autofs submounts must be
304803
set as browasble but amd type auto mounts that have the cache:=all
304803
option set need to read in the map without the browse option being
304803
set.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG                |    1 +
304803
 modules/lookup_ldap.c    |   10 ++++++----
304803
 modules/lookup_nisplus.c |   10 ++++++----
304803
 modules/lookup_sss.c     |   10 ++++++----
304803
 modules/lookup_yp.c      |   10 ++++++----
304803
 modules/mount_autofs.c   |    3 +++
304803
 6 files changed, 28 insertions(+), 16 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -232,6 +232,7 @@
304803
 - add function conf_get_map_options().
304803
 - capture cache option and its settings during parsing.
304803
 - handle map_option cache for top level mounts.
304803
+- handle amd cache option all in amd type auto mounts.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/lookup_ldap.c
304803
+++ autofs-5.0.7/modules/lookup_ldap.c
304803
@@ -2797,11 +2797,13 @@ static int read_one_map(struct autofs_po
304803
 	int rv, l;
304803
 
304803
 	/*
304803
-	 * If we don't need to create directories then there's no use
304803
-	 * reading the map. We always need to read the whole map for
304803
-	 * direct mounts in order to mount the triggers.
304803
+	 * If we don't need to create directories (or don't need
304803
+	 * to read an amd cache:=all map) then there's no use
304803
+	 * reading the map. We always need to read the whole map
304803
+	 * for direct mounts in order to mount the triggers.
304803
 	 */
304803
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
304803
+	if (ap->type != LKP_DIRECT &&
304803
+	    !(ap->flags & (MOUNT_FLAG_GHOST|MOUNT_FLAG_AMD_CACHE_ALL))) {
304803
 		debug(ap->logopt, "map read not needed, so not done");
304803
 		return NSS_STATUS_SUCCESS;
304803
 	}
304803
--- autofs-5.0.7.orig/modules/lookup_nisplus.c
304803
+++ autofs-5.0.7/modules/lookup_nisplus.c
304803
@@ -239,11 +239,13 @@ int lookup_read_map(struct autofs_point
304803
 	master_source_current_signal(ap->entry);
304803
 
304803
 	/*
304803
-	 * If we don't need to create directories then there's no use
304803
-	 * reading the map. We always need to read the whole map for
304803
-	 * direct mounts in order to mount the triggers.
304803
+	 * If we don't need to create directories (or don't need
304803
+	 * to read an amd cache:=all map) then there's no use
304803
+	 * reading the map. We always need to read the whole map
304803
+	 * for direct mounts in order to mount the triggers.
304803
 	 */
304803
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
304803
+	if (ap->type != LKP_DIRECT &&
304803
+	    !(ap->flags & (MOUNT_FLAG_GHOST|MOUNT_FLAG_AMD_CACHE_ALL))) {
304803
 		debug(ap->logopt, "map read not needed, so not done");
304803
 		return NSS_STATUS_SUCCESS;
304803
 	}
304803
--- autofs-5.0.7.orig/modules/lookup_sss.c
304803
+++ autofs-5.0.7/modules/lookup_sss.c
304803
@@ -340,11 +340,13 @@ int lookup_read_map(struct autofs_point
304803
 	mc = source->mc;
304803
 
304803
 	/*
304803
-	 * If we don't need to create directories then there's no use
304803
-	 * reading the map. We always need to read the whole map for
304803
-	 * direct mounts in order to mount the triggers.
304803
+	 * If we don't need to create directories (or don't need
304803
+	 * to read an amd cache:=all map) then there's no use
304803
+	 * reading the map. We always need to read the whole map
304803
+	 * for direct mounts in order to mount the triggers.
304803
 	 */
304803
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
304803
+	if (ap->type != LKP_DIRECT &&
304803
+	    !(ap->flags & (MOUNT_FLAG_GHOST|MOUNT_FLAG_AMD_CACHE_ALL))) {
304803
 		debug(ap->logopt, "map read not needed, so not done");
304803
 		return NSS_STATUS_SUCCESS;
304803
 	}
304803
--- autofs-5.0.7.orig/modules/lookup_yp.c
304803
+++ autofs-5.0.7/modules/lookup_yp.c
304803
@@ -401,11 +401,13 @@ int lookup_read_map(struct autofs_point
304803
 	master_source_current_signal(ap->entry);
304803
 
304803
 	/*
304803
-	 * If we don't need to create directories then there's no use
304803
-	 * reading the map. We always need to read the whole map for
304803
-	 * direct mounts in order to mount the triggers.
304803
+	 * If we don't need to create directories (or don't need
304803
+	 * to read an amd cache:=all map) then there's no use
304803
+	 * reading the map. We always need to read the whole map
304803
+	 * for direct mounts in order to mount the triggers.
304803
 	 */
304803
-	if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT) {
304803
+	if (ap->type != LKP_DIRECT &&
304803
+	    !(ap->flags & (MOUNT_FLAG_GHOST|MOUNT_FLAG_AMD_CACHE_ALL))) {
304803
 		debug(ap->logopt, "map read not needed, so not done");
304803
 		return NSS_STATUS_SUCCESS;
304803
 	}
304803
--- autofs-5.0.7.orig/modules/mount_autofs.c
304803
+++ autofs-5.0.7/modules/mount_autofs.c
304803
@@ -288,6 +288,9 @@ int mount_mount(struct autofs_point *ap,
304803
 			nap->pref = am_entry->pref;
304803
 			am_entry->pref = NULL;
304803
 		}
304803
+
304803
+		if (am_entry->cache_opts & AMD_CACHE_OPTION_ALL)
304803
+			nap->flags |= MOUNT_FLAG_AMD_CACHE_ALL;
304803
 	}
304803
 
304803
 	if (handle_mounts_startup_cond_init(&suc)) {