From c79bfcab9942f9333c3308639af0cabc1c0a6ea0 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 11 2020 22:13:16 +0000 Subject: Apply patch autofs-5.1.4-mark-removed-cache-entry-negative.patch patch_name: autofs-5.1.4-mark-removed-cache-entry-negative.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index 23ea1a8..a06ecfb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -29,6 +29,7 @@ xx/xx/2018 autofs-5.1.5 - covarity fixes. - fix program usage message. - fix update_negative_cache() map source usage. +- mark removed cache entry negative. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/daemon/lookup.c b/daemon/lookup.c index 418f01c..18df935 100644 --- a/daemon/lookup.c +++ b/daemon/lookup.c @@ -1417,15 +1417,21 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti 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. + * the current cache so it isn't really valid. Set the + * mapent negative to prevent further mount requests + * using the cache entry. */ + debug(ap->logopt, "removed map entry detected, mark negative"); + if (valid->mapent) { + free(valid->mapent); + valid->mapent = NULL; + } cache_unlock(valid->mc); valid = NULL; } if (!valid && is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) { - debug(ap->logopt, - "prune check posponed, %s mounted", path); + debug(ap->logopt, "prune posponed, %s mounted", path); free(key); free(path); continue;