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