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

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