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

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