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

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