Blame SOURCES/autofs-5.1.0-guard-against-incorrect-umount-return.patch

306fa1
autofs-5.1.0 - guard against incorrect umount return
306fa1
306fa1
From: Ian Kent <ikent@redhat.com>
306fa1
306fa1
If umount(8) returns a fail but the mount is actually umounted autofs
306fa1
can incorrectly try reconstruct mount triggers. This can lead to the
306fa1
automount point becoming unresponsive.
306fa1
---
306fa1
 CHANGELOG          |    1 +
306fa1
 daemon/automount.c |    3 ++-
306fa1
 lib/mounts.c       |    6 ++++--
306fa1
 3 files changed, 7 insertions(+), 3 deletions(-)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -184,6 +184,7 @@
306fa1
 - fix out of order call in program map lookup.
306fa1
 - make service want network-online.
306fa1
 - add remote-fs.target systemd dependency.
306fa1
+- gaurd against incorrect umount return.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/daemon/automount.c
306fa1
+++ autofs-5.0.7/daemon/automount.c
306fa1
@@ -532,7 +532,8 @@ static int umount_subtree_mounts(struct
306fa1
 	if (!is_mm_root && is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
306fa1
 		struct amd_entry *entry;
306fa1
 		debug(ap->logopt, "unmounting dir = %s", path);
306fa1
-		if (umount_ent(ap, path)) {
306fa1
+		if (umount_ent(ap, path) &&
306fa1
+		    is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
306fa1
 			warn(ap->logopt, "could not umount dir %s", path);
306fa1
 			left++;
306fa1
 			goto done;
306fa1
--- autofs-5.0.7.orig/lib/mounts.c
306fa1
+++ autofs-5.0.7/lib/mounts.c
306fa1
@@ -2126,7 +2126,8 @@ int umount_multi_triggers(struct autofs_
306fa1
 		 */
306fa1
 		if (is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) {
306fa1
 			info(ap->logopt, "unmounting dir = %s", root);
306fa1
-			if (umount_ent(ap, root)) {
306fa1
+			if (umount_ent(ap, root) &&
306fa1
+			    is_mounted(_PATH_MOUNTED, root, MNTS_REAL)) {
306fa1
 				if (mount_multi_triggers(ap, me, root, strlen(root), "/") < 0)
306fa1
 					warn(ap->logopt,
306fa1
 					     "failed to remount offset triggers");
306fa1
@@ -2227,7 +2228,8 @@ int clean_stale_multi_triggers(struct au
306fa1
 		 */
306fa1
 		if (oe->ioctlfd != -1 ||
306fa1
 		    is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) {
306fa1
-			if (umount_ent(ap, oe->key)) {
306fa1
+			if (umount_ent(ap, oe->key) &&
306fa1
+			    is_mounted(_PROC_MOUNTS, oe->key, MNTS_REAL)) {
306fa1
 				debug(ap->logopt,
306fa1
 				      "offset %s has active mount, invalidate",
306fa1
 				      oe->key);