Sophie

Sophie

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

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

autofs-5.0.1 - fix prune cache valid check

From: Ian Kent <raven@themaw.net>

During a map reload, when pruning the cache we look for a valid map entry
in another map. In lookup_prune_one_cache() There is a missing check for
the entry being in the current map which causes the directory cleanup code
from doing its job.
---

 daemon/lookup.c |    8 ++++++++
 1 file changed, 8 insertions(+)


--- autofs-5.0.1.orig/daemon/lookup.c
+++ autofs-5.0.1/daemon/lookup.c
@@ -1052,6 +1052,14 @@ void lookup_prune_one_cache(struct autof
 		 * cache entry.
 		 */
 		valid = lookup_source_valid_mapent(ap, key, LKP_DISTINCT);
+		if (valid && valid->mc == mc) {
+			 /*
+			  * We've found a map entry that has been removed from
+			  * the current cache so it isn't really valid.
+			  */
+			cache_unlock(valid->mc);
+			valid = NULL;
+		}
 		if (!valid &&
 		    is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
 			debug(ap->logopt,