Ian Kent e6cf32
diff --git a/CHANGELOG b/CHANGELOG
Ian Kent e6cf32
index eb4cce1..a0c7fa3 100644
Ian Kent e6cf32
--- a/CHANGELOG
Ian Kent e6cf32
+++ b/CHANGELOG
Ian Kent e6cf32
@@ -7,6 +7,7 @@
Ian Kent e6cf32
 - use libldap instead of libldap_r (Guillaume Rousse).
Ian Kent e6cf32
 - another fix for don't fail on empty master map.
Ian Kent e6cf32
 - fix expire working harder than needed.
Ian Kent e6cf32
+- fix unlink of mount tree incorrectly causing autofs mount fail.
Ian Kent e6cf32
  
Ian Kent e6cf32
 14/01/2008 autofs-5.0.3
Ian Kent e6cf32
 -----------------------
Ian Kent e6cf32
diff --git a/daemon/direct.c b/daemon/direct.c
Ian Kent e6cf32
index 760fbd4..8d1e9c6 100644
Ian Kent e6cf32
--- a/daemon/direct.c
Ian Kent e6cf32
+++ b/daemon/direct.c
Ian Kent e6cf32
@@ -275,7 +275,6 @@ static int unlink_mount_tree(struct autofs_point *ap, struct list_head *list)
Ian Kent e6cf32
 		else
Ian Kent e6cf32
 			rv = umount2(mnt->path, MNT_DETACH);
Ian Kent e6cf32
 		if (rv == -1) {
Ian Kent e6cf32
-			ret = 0;
Ian Kent e6cf32
 			debug(ap->logopt,
Ian Kent e6cf32
 			      "can't unlink %s from mount tree", mnt->path);
Ian Kent e6cf32
 
Ian Kent e6cf32
@@ -287,6 +286,7 @@ static int unlink_mount_tree(struct autofs_point *ap, struct list_head *list)
Ian Kent e6cf32
 
Ian Kent e6cf32
 			case ENOENT:
Ian Kent e6cf32
 			case EFAULT:
Ian Kent e6cf32
+				ret = 0;
Ian Kent e6cf32
 				warn(ap->logopt, "bad path for mount");
Ian Kent e6cf32
 				break;
Ian Kent e6cf32
 			}
Ian Kent e6cf32
diff --git a/daemon/indirect.c b/daemon/indirect.c
Ian Kent e6cf32
index 39b42da..f0409ac 100644
Ian Kent e6cf32
--- a/daemon/indirect.c
Ian Kent e6cf32
+++ b/daemon/indirect.c
Ian Kent e6cf32
@@ -65,7 +65,6 @@ static int unlink_mount_tree(struct autofs_point *ap, struct mnt_list *mnts)
Ian Kent e6cf32
 		else
Ian Kent e6cf32
 			rv = umount2(this->path, MNT_DETACH);
Ian Kent e6cf32
 		if (rv == -1) {
Ian Kent e6cf32
-			ret = 0;
Ian Kent e6cf32
 			debug(ap->logopt,
Ian Kent e6cf32
 			      "can't unlink %s from mount tree", this->path);
Ian Kent e6cf32
 
Ian Kent e6cf32
@@ -77,6 +76,7 @@ static int unlink_mount_tree(struct autofs_point *ap, struct mnt_list *mnts)
Ian Kent e6cf32
 
Ian Kent e6cf32
 			case ENOENT:
Ian Kent e6cf32
 			case EFAULT:
Ian Kent e6cf32
+				ret = 0;
Ian Kent e6cf32
 				warn(ap->logopt, "bad path for mount");
Ian Kent e6cf32
 				break;
Ian Kent e6cf32
 			}