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

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