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