Blame SOURCES/autofs-5.1.0-ensure-negative-cache-isnt-updated-on-remount.patch

304803
autofs-5.1.0 - ensure negative cache isn't updated on remount
304803
304803
From: Ian Kent <ikent@redhat.com>
304803
304803
The negative cache shouldn't be updated when re-connecting at
304803
startup but a couple of lookup modules didn't check for this
304803
case.
304803
---
304803
 CHANGELOG                |    1 +
304803
 modules/lookup_hosts.c   |    3 +++
304803
 modules/lookup_program.c |    3 +++
304803
 3 files changed, 7 insertions(+)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -160,6 +160,7 @@
304803
 - fix typo in update_hosts_mounts().
304803
 - fix hosts map update on reload.
304803
 - make negative cache update consistent for all lookup modules.
304803
+- ensure negative cache isn't updated on remount.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/lookup_hosts.c
304803
+++ autofs-5.0.7/modules/lookup_hosts.c
304803
@@ -151,6 +151,9 @@ static int do_parse_mount(struct autofs_
304803
 	if (ret) {
304803
 		struct mapent_cache *mc = source->mc;
304803
 
304803
+		/* Don't update negative cache when re-connecting */
304803
+		if (ap->flags & MOUNT_FLAG_REMOUNT)
304803
+			return NSS_STATUS_TRYAGAIN;
304803
 		cache_writelock(mc);
304803
 		cache_update_negative(mc, source, name, ap->negative_timeout);
304803
 		cache_unlock(mc);
304803
--- autofs-5.0.7.orig/modules/lookup_program.c
304803
+++ autofs-5.0.7/modules/lookup_program.c
304803
@@ -622,6 +622,9 @@ out_free:
304803
 		free(mapent);
304803
 
304803
 	if (ret) {
304803
+		/* Don't update negative cache when re-connecting */
304803
+		if (ap->flags & MOUNT_FLAG_REMOUNT)
304803
+			return NSS_STATUS_TRYAGAIN;
304803
 		cache_writelock(mc);
304803
 		cache_update_negative(mc, source, name, ap->negative_timeout);
304803
 		cache_unlock(mc);