Blob Blame History Raw
autofs-5.1.4 - make umount_ent() recognise forced umount

From: Ian Kent <raven@themaw.net>

When doing a forced shutdown umount_ent() tries a normal expire
first resulting in a fair amount of unnecessary log noise.

Change umount_ent() to do a forced expire when a forced shutdown
has been requested to avoid the log noise.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG    |    1 +
 lib/mounts.c |   16 +++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

--- autofs-5.1.4.orig/lib/mounts.c
+++ autofs-5.1.4/lib/mounts.c
@@ -2029,14 +2029,16 @@ int umount_ent(struct autofs_point *ap,
 {
 	int rv;
 
-	rv = spawn_umount(ap->logopt, path, NULL);
-	/* We are doing a forced shutcwdown down so unlink busy mounts */
-	if (rv && (ap->state == ST_SHUTDOWN_FORCE || ap->state == ST_SHUTDOWN)) {
-		if (ap->state == ST_SHUTDOWN_FORCE) {
-			info(ap->logopt, "forcing umount of %s", path);
-			rv = spawn_umount(ap->logopt, "-l", path, NULL);
-		}
+	if (ap->state != ST_SHUTDOWN_FORCE)
+		rv = spawn_umount(ap->logopt, path, NULL);
+	else {
+		/* We are doing a forced shutdown so unlink busy
+		 * mounts */
+		info(ap->logopt, "forcing umount of %s", path);
+		rv = spawn_umount(ap->logopt, "-l", path, NULL);
+	}
 
+	if (rv && (ap->state == ST_SHUTDOWN_FORCE || ap->state == ST_SHUTDOWN)) {
 		/*
 		 * Verify that we actually unmounted the thing.  This is a
 		 * belt and suspenders approach to not eating user data.
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -28,6 +28,7 @@ xx/xx/2018 autofs-5.1.5
 - add-man page note about extra slashes in paths.
 - change expire type naming to better reflect usage.
 - use defines for expire type.
+- make umount_ent() recognise forced umount.
 
 19/12/2017 autofs-5.1.4
 - fix spec file url.