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

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