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

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