Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 71

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs-5.0.1 - fix negative cache included map lookup

From: Ian Kent <raven@themaw.net>

If we are looking up a mount from multiple included map sources we
can't update the negative cache until we have looked at all sources.
If we don't postpone the negative cache update we will get a false
negative on a subsequent lookups.

Also clean up "not found" message.
---

 daemon/lookup.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


--- autofs-5.0.1.orig/daemon/lookup.c
+++ autofs-5.0.1/daemon/lookup.c
@@ -802,6 +802,10 @@ static void update_negative_cache(struct
 	struct map_source *map;
 	struct mapent *me;
 
+	/* Don't update negative cache for included maps */ 
+	if (source && source->depth)
+		return;
+
 	/* Have we recorded the lookup fail for negative caching? */
 	me = lookup_source_mapent(ap, name, LKP_DISTINCT);
 	if (me)
@@ -812,7 +816,7 @@ static void update_negative_cache(struct
 		cache_unlock(me->mc);
 	else {
 		/* Notify only once after fail */
-		error(ap->logopt, "key \"%s\" not found in map.", name);
+		logmsg("key \"%s\" not found in map source(s).", name);
 
 		/* Doesn't exist in any source, just add it somewhere */
 		if (source)