Blame SOURCES/autofs-5.1.4-make-umount_ent-recognise-forced-umount.patch

792147
autofs-5.1.4 - make umount_ent() recognise forced umount
792147
792147
From: Ian Kent <raven@themaw.net>
792147
792147
When doing a forced shutdown umount_ent() tries a normal expire
792147
first resulting in a fair amount of unnecessary log noise.
792147
792147
Change umount_ent() to do a forced expire when a forced shutdown
792147
has been requested to avoid the log noise.
792147
792147
Signed-off-by: Ian Kent <raven@themaw.net>
792147
---
792147
 lib/mounts.c |   16 +++++++++-------
792147
 1 file changed, 9 insertions(+), 7 deletions(-)
792147
792147
--- autofs-5.1.4.orig/lib/mounts.c
792147
+++ autofs-5.1.4/lib/mounts.c
792147
@@ -2984,14 +2984,16 @@ int umount_ent(struct autofs_point *ap,
792147
 {
792147
 	int rv;
792147
 
792147
-	rv = spawn_umount(ap->logopt, path, NULL);
792147
-	/* We are doing a forced shutcwdown down so unlink busy mounts */
792147
-	if (rv && (ap->state == ST_SHUTDOWN_FORCE || ap->state == ST_SHUTDOWN)) {
792147
-		if (ap->state == ST_SHUTDOWN_FORCE) {
792147
-			info(ap->logopt, "forcing umount of %s", path);
792147
-			rv = spawn_umount(ap->logopt, "-l", path, NULL);
792147
-		}
792147
+	if (ap->state != ST_SHUTDOWN_FORCE)
792147
+		rv = spawn_umount(ap->logopt, path, NULL);
792147
+	else {
792147
+		/* We are doing a forced shutdown so unlink busy
792147
+		 * mounts */
792147
+		info(ap->logopt, "forcing umount of %s", path);
792147
+		rv = spawn_umount(ap->logopt, "-l", path, NULL);
792147
+	}
792147
 
792147
+	if (rv && (ap->state == ST_SHUTDOWN_FORCE || ap->state == ST_SHUTDOWN)) {
792147
 		/*
792147
 		 * Verify that we actually unmounted the thing.  This is a
792147
 		 * belt and suspenders approach to not eating user data.