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)