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

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