Blame SOURCES/autofs-5.1.0-fix-hosts-map-update-on-reload.patch

304803
autofs-5.1.0 - fix hosts map update on reload
304803
304803
From: Ian Kent <ikent@redhat.com>
304803
304803
Commit aedfd5aa - "amd lookup fix host mount naming" introduced a
304803
regression when updating sun format maps.
304803
304803
The amd host mount type assumes the lookup name is the host name for
304803
the host mount but amd uses ${rhost} for this.
304803
304803
This introduces the possibility of multiple concurrent mount requests
304803
since constructing a mount tree that isn't under the lookup name can't
304803
take advantage of the kernel queuing of other concurrent lookups while
304803
the mount tree is constructed.
304803
304803
Consequently multi-mount updates (currently only done for the internal
304803
hosts map which the amd parser also uses for its hosts map) can't be
304803
allowed for amd mounts.
304803
---
304803
 CHANGELOG           |    1 +
304803
 modules/parse_sun.c |   37 ++++++++++++++++++++++++++++---------
304803
 2 files changed, 29 insertions(+), 9 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -158,6 +158,7 @@
304803
 - update man page autofs(8) for systemd.
304803
 - fix fix master map type check.
304803
 - fix typo in update_hosts_mounts().
304803
+- fix hosts map update on reload.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/parse_sun.c
304803
+++ autofs-5.0.7/modules/parse_sun.c
304803
@@ -1356,16 +1356,35 @@ int parse_mount(struct autofs_point *ap,
304803
 		}
304803
 
304803
 		cache_multi_writelock(me);
304803
-		/* Someone beat us to it, return success */
304803
-		if (me->multi) {
304803
-			free(options);
304803
-			cache_multi_unlock(me);
304803
-			cache_unlock(mc);
304803
-			pthread_setcancelstate(cur_state, NULL);
304803
-			return 0;
304803
-		}
304803
 		/* So we know we're the multi-mount root */
304803
-		me->multi = me;
304803
+		if (!me->multi)
304803
+			me->multi = me;
304803
+		else {
304803
+			/*
304803
+			 * The amd host mount type assumes the lookup name
304803
+			 * is the host name for the host mount but amd uses
304803
+			 * ${rhost} for this.
304803
+			 *
304803
+			 * This introduces the possibility of multiple
304803
+			 * concurrent mount requests since constructing a
304803
+			 * mount tree that isn't under the lookup name can't
304803
+			 * take advantage of the kernel queuing of other
304803
+			 * concurrent lookups while the mount tree is
304803
+			 * constructed.
304803
+			 *
304803
+			 * Consequently multi-mount updates (currently only
304803
+			 * done for the internal hosts map which the amd
304803
+			 * parser also uses for its hosts map) can't be
304803
+			 * allowed for amd mounts.
304803
+			 */
304803
+			if (source->flags & MAP_FLAG_FORMAT_AMD) {
304803
+				free(options);
304803
+				cache_multi_unlock(me);
304803
+				cache_unlock(mc);
304803
+				pthread_setcancelstate(cur_state, NULL);
304803
+				return 0;
304803
+			}
304803
+		}
304803
 
304803
 		age = me->age;
304803