Blame SOURCES/autofs-5.1.7-fix-lookup_prune_one_cache-refactoring-change.patch

96dc52
autofs-5.1.7 - fix lookup_prune_one_cache() refactoring change
96dc52
96dc52
From: Ian Kent <raven@themaw.net>
96dc52
96dc52
Commit 256963d6b (autofs-5.1.7 - refactor lookup_prune_one_cache() a bit)
96dc52
changed the position of the getting the next enumeration map entry but
96dc52
failed to update a couple of other locations that assume the next map
96dc52
entry has been set. Under certain fairly common conditions this leads
96dc52
to an infinite loop.
96dc52
96dc52
Signed-off-by: Ian Kent <raven@themaw.net>
96dc52
---
96dc52
 CHANGELOG       |    1 +
96dc52
 daemon/lookup.c |    5 ++++-
96dc52
 2 files changed, 5 insertions(+), 1 deletion(-)
96dc52
96dc52
--- autofs-5.1.7.orig/CHANGELOG
96dc52
+++ autofs-5.1.7/CHANGELOG
96dc52
@@ -74,6 +74,7 @@
96dc52
 - eliminate redundant cache lookup in tree_mapent_add_node().
96dc52
 - fix hosts map offset order.
96dc52
 - fix direct mount deadlock.
96dc52
+- fix lookup_prune_one_cache() refactoring change.
96dc52
 
96dc52
 25/01/2021 autofs-5.1.7
96dc52
 - make bind mounts propagation slave by default.
96dc52
--- autofs-5.1.7.orig/daemon/lookup.c
96dc52
+++ autofs-5.1.7/daemon/lookup.c
96dc52
@@ -1379,6 +1379,7 @@ void lookup_prune_one_cache(struct autof
96dc52
 		if (!key || strchr(key, '*')) {
96dc52
 			if (key)
96dc52
 				free(key);
96dc52
+			me = cache_enumerate(mc, me);
96dc52
 			continue;
96dc52
 		}
96dc52
 
96dc52
@@ -1386,6 +1387,7 @@ void lookup_prune_one_cache(struct autof
96dc52
 		if (!path) {
96dc52
 			warn(ap->logopt, "can't malloc storage for path");
96dc52
 			free(key);
96dc52
+			me = cache_enumerate(mc, me);
96dc52
 			continue;
96dc52
 		}
96dc52
 
96dc52
@@ -1413,9 +1415,10 @@ void lookup_prune_one_cache(struct autof
96dc52
 		}
96dc52
 		if (!valid &&
96dc52
 		    is_mounted(path, MNTS_REAL)) {
96dc52
-			debug(ap->logopt, "prune posponed, %s mounted", path);
96dc52
+			debug(ap->logopt, "prune postponed, %s mounted", path);
96dc52
 			free(key);
96dc52
 			free(path);
96dc52
+			me = cache_enumerate(mc, me);
96dc52
 			continue;
96dc52
 		}
96dc52
 		if (valid)