Blame SOURCES/autofs-5.1.7-fix-return-from-umount_subtree_mounts-on-offset-list-delete.patch

29d2b9
autofs-5.1.7 - fix return from umount_subtree_mounts() on offset list delete
29d2b9
29d2b9
From: Ian Kent <raven@themaw.net>
29d2b9
29d2b9
When there are no mounts left in a subtree of offset mounts the offset
29d2b9
list is deleted. If all goes well deleting the list this shouldn't cause
29d2b9
a positive return from umount_subtree_mounts() (essentially saying that
29d2b9
the umount of the subtree has not succeeded).
29d2b9
29d2b9
Signed-off-by: Ian Kent <raven@themaw.net>
29d2b9
---
29d2b9
 CHANGELOG          |    1 +
29d2b9
 daemon/automount.c |    5 +++--
29d2b9
 2 files changed, 4 insertions(+), 2 deletions(-)
29d2b9
29d2b9
diff --git a/CHANGELOG b/CHANGELOG
29d2b9
index 64e619ec..6e0edd74 100644
29d2b9
--- a/CHANGELOG
29d2b9
+++ b/CHANGELOG
29d2b9
@@ -16,6 +16,7 @@
29d2b9
 - simplify mount_subtree() mount check.
29d2b9
 - fix mnts_get_expire_list() expire list construction.
29d2b9
 - fix inconsistent locking in umount_subtree_mounts().
29d2b9
+- fix return from umount_subtree_mounts() on offset list delete.
29d2b9
 
29d2b9
 25/01/2021 autofs-5.1.7
29d2b9
 - make bind mounts propagation slave by default.
29d2b9
diff --git a/daemon/automount.c b/daemon/automount.c
29d2b9
index 93bd8556..62530b6b 100644
29d2b9
--- a/daemon/automount.c
29d2b9
+++ b/daemon/automount.c
29d2b9
@@ -590,9 +590,10 @@ static int umount_subtree_mounts(struct autofs_point *ap, const char *path, unsi
29d2b9
 
29d2b9
 		if (!left && is_mm_root) {
29d2b9
 			status = cache_delete_offset_list(mc, me->key);
29d2b9
-			if (status != CHE_OK)
29d2b9
+			if (status != CHE_OK) {
29d2b9
 				warn(ap->logopt, "couldn't delete offset list");
29d2b9
-			left++;
29d2b9
+				left++;
29d2b9
+			}
29d2b9
 		}
29d2b9
 
29d2b9
 		if (ap->entry->maps &&