Blame SOURCES/autofs-5.1.2-delay-submount-exit-for-amd-submounts.patch

4d476f
autofs-5.1.2 - delay submount exit for amd submounts
4d476f
4d476f
From: Ian Kent <raven@themaw.net>
4d476f
4d476f
For amd format maps it's better to not expire away submounts (amd
4d476f
type "auto" mounts) straight way.
4d476f
4d476f
This is because of the common heavy reuse of maps in amd maps and
4d476f
we want to try and avoid constantly re-reading large maps.
4d476f
4d476f
Signed-off-by: Ian Kent <raven@themaw.net>
4d476f
---
4d476f
 CHANGELOG      |    1 +
4d476f
 daemon/state.c |   18 +++++++++++++++---
4d476f
 2 files changed, 16 insertions(+), 3 deletions(-)
4d476f
4d476f
--- autofs-5.0.7.orig/CHANGELOG
4d476f
+++ autofs-5.0.7/CHANGELOG
4d476f
@@ -234,6 +234,7 @@
4d476f
 - handle map_option cache for top level mounts.
4d476f
 - handle amd cache option all in amd type auto mounts.
4d476f
 - fix bogus check in expire_cleanup().
4d476f
+- delay submount exit for amd submounts.
4d476f
 
4d476f
 25/07/2012 autofs-5.0.7
4d476f
 =======================
4d476f
--- autofs-5.0.7.orig/daemon/state.c
4d476f
+++ autofs-5.0.7/daemon/state.c
4d476f
@@ -132,15 +132,27 @@ void expire_cleanup(void *arg)
4d476f
 			 * mount expires in a reasonable time. Just skip
4d476f
 			 * one expire check after it's no longer busy before
4d476f
 			 * allowing it to shutdown.
4d476f
+			 *
4d476f
+			 * But if this mount point is an amd format map it
4d476f
+			 * is better to keep the mount around longer. This
4d476f
+			 * is because of the common heavy reuse of maps in
4d476f
+			 * amd maps and we want to try and avoid constantly
4d476f
+			 * re-reading large maps.
4d476f
 			 */
4d476f
 			if (ap->submount && !success) {
4d476f
 				rv = ops->askumount(ap->logopt, ap->ioctlfd, &idle);
4d476f
 				if (!rv && idle && ap->submount > 1) {
4d476f
-					next = ST_SHUTDOWN_PENDING;
4d476f
-					break;
4d476f
+					struct map_source *map = ap->entry->maps;
4d476f
+
4d476f
+					if (ap->submount > 4 ||
4d476f
+					   !(map->flags & MAP_FLAG_FORMAT_AMD)) {
4d476f
+						next = ST_SHUTDOWN_PENDING;
4d476f
+						break;
4d476f
+					}
4d476f
 				}
4d476f
 				ap->submount++;
4d476f
-			}
4d476f
+			} else if (ap->submount > 1)
4d476f
+				ap->submount = 1;
4d476f
 
4d476f
 			if (ap->state == ST_EXPIRE && !ap->submount)
4d476f
 				alarm_add(ap, ap->exp_runfreq);