Blame SOURCES/autofs-5.1.6-dont-prune-offset-map-entries.patch

63b9c2
autofs-5.1.6 - dont prune offset map entries
63b9c2
63b9c2
From: Ian Kent <raven@themaw.net>
63b9c2
63b9c2
Indirect maps create offset map entries for multi-mount map entries on
63b9c2
deamnd and remove them when they expire.
63b9c2
63b9c2
Since they are created based on an owning map entry they don't correspond
63b9c2
to an actual map entry so they, and their owning map entry, should never
63b9c2
be pruned.
63b9c2
63b9c2
Signed-off-by: Ian Kent <raven@themaw.net>
63b9c2
---
63b9c2
 CHANGELOG       |    1 +
63b9c2
 daemon/lookup.c |    9 +++++++++
63b9c2
 2 files changed, 10 insertions(+)
63b9c2
63b9c2
diff --git a/CHANGELOG b/CHANGELOG
63b9c2
index 3608345..34b160e 100644
63b9c2
--- a/CHANGELOG
63b9c2
+++ b/CHANGELOG
63b9c2
@@ -109,6 +109,7 @@ xx/xx/2018 autofs-5.1.5
63b9c2
 - refactor sss getautomntbyname().
63b9c2
 - improve sss getautomntbyname() error handling.
63b9c2
 - use a valid timeout in lookup_prune_one_cache().
63b9c2
+- dont prune offset map entries.
63b9c2
 
63b9c2
 19/12/2017 autofs-5.1.4
63b9c2
 - fix spec file url.
63b9c2
diff --git a/daemon/lookup.c b/daemon/lookup.c
63b9c2
index 8bf1335..2de622e 100644
63b9c2
--- a/daemon/lookup.c
63b9c2
+++ b/daemon/lookup.c
63b9c2
@@ -1355,6 +1355,15 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
63b9c2
 		}
63b9c2
 
63b9c2
 		if (ap->type == LKP_INDIRECT) {
63b9c2
+			/* Don't prune offset map entries since they are
63b9c2
+			 * created on demand and managed by expire and don't
63b9c2
+			 * prune the multi-map owner map entry.
63b9c2
+			 */
63b9c2
+			if (*me->key == '/' || me->multi == me) {
63b9c2
+				me = cache_enumerate(mc, me);
63b9c2
+				continue;
63b9c2
+			}
63b9c2
+
63b9c2
 			/* If the map hasn't been read (nobrowse
63b9c2
 			 * indirect mounts) then keep cached entries
63b9c2
 			 * for POSITIVE_TIMEOUT.