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

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