Blame SOURCES/autofs-5.1.0-dont-add-wildcard-to-negative-cache.patch

306fa1
autofs-5.1.0 - dont add wildcard to negative cache
306fa1
306fa1
From: Ian Kent <ikent@redhat.com>
306fa1
306fa1
If the wilcard is added to the negative cache it prevents any
306fa1
further matching of the wildcard for the given map.
306fa1
---
306fa1
 CHANGELOG       |    1 +
306fa1
 daemon/lookup.c |    4 ++++
306fa1
 lib/cache.c     |    4 ++++
306fa1
 3 files changed, 9 insertions(+)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -161,6 +161,7 @@
306fa1
 - fix hosts map update on reload.
306fa1
 - make negative cache update consistent for all lookup modules.
306fa1
 - ensure negative cache isn't updated on remount.
306fa1
+- dont add wildcard to negative cache.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/daemon/lookup.c
306fa1
+++ autofs-5.0.7/daemon/lookup.c
306fa1
@@ -1057,6 +1057,10 @@ static void update_negative_cache(struct
306fa1
 	if (source && source->depth)
306fa1
 		return;
306fa1
 
306fa1
+	/* Don't update the wildcard */
306fa1
+	if (strlen(name) == 1 && *name == '*')
306fa1
+		return;
306fa1
+
306fa1
 	/* Have we recorded the lookup fail for negative caching? */
306fa1
 	me = lookup_source_mapent(ap, name, LKP_DISTINCT);
306fa1
 	if (me)
306fa1
--- autofs-5.0.7.orig/lib/cache.c
306fa1
+++ autofs-5.0.7/lib/cache.c
306fa1
@@ -762,6 +762,10 @@ void cache_update_negative(struct mapent
306fa1
 	struct mapent *me;
306fa1
 	int rv = CHE_OK;
306fa1
 
306fa1
+	/* Don't update the wildcard */
306fa1
+	if (strlen(key) == 1 && *key == '*')
306fa1
+		return;
306fa1
+
306fa1
 	me = cache_lookup_distinct(mc, key);
306fa1
 	if (me)
306fa1
 		rv = cache_push_mapent(me, NULL);