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

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