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

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