Blame SOURCES/autofs-5.1.8-remove-nonstrict-parameter-from-tree_mapent_umount_offsets.patch

91594d
autofs-5.1.8 - remove nonstrict parameter from tree_mapent_umount_offsets()
91594d
91594d
From: Ian Kent <raven@themaw.net>
91594d
91594d
The nonstrict parameter of tree_mapent_umount_offsets() ins't useful
91594d
because if a real mount at the base of a sub-tree fails to umount all
91594d
we can do is re-instate the offset mounts under it which must succeed
91594d
for the mount tree to remain useful.
91594d
91594d
Signed-off-by: Ian Kent <raven@themaw.net>
91594d
---
91594d
 CHANGELOG          |    1 +
91594d
 daemon/automount.c |    2 +-
91594d
 include/mounts.h   |    2 +-
91594d
 lib/mounts.c       |    6 +++---
91594d
 4 files changed, 6 insertions(+), 5 deletions(-)
91594d
91594d
--- autofs-5.1.7.orig/CHANGELOG
91594d
+++ autofs-5.1.7/CHANGELOG
91594d
@@ -94,6 +94,7 @@
91594d
 - fix memory leak in xdr_exports().
91594d
 - avoid calling pthread_getspecific() with NULL key_thread_attempt_id.
91594d
 - fix sysconf(3) return handling.
91594d
+- remove nonstrict parameter from tree_mapent_umount_offsets().
91594d
 
91594d
 25/01/2021 autofs-5.1.7
91594d
 - make bind mounts propagation slave by default.
91594d
--- autofs-5.1.7.orig/daemon/automount.c
91594d
+++ autofs-5.1.7/daemon/automount.c
91594d
@@ -554,7 +554,7 @@ static int umount_subtree_mounts(struct
91594d
 		struct mapent *tmp;
91594d
 		int ret;
91594d
 
91594d
-		ret = tree_mapent_umount_offsets(me, 1);
91594d
+		ret = tree_mapent_umount_offsets(me);
91594d
 		if (!ret) {
91594d
 			warn(ap->logopt,
91594d
 			     "some offset mounts still present under %s", path);
91594d
--- autofs-5.1.7.orig/include/mounts.h
91594d
+++ autofs-5.1.7/include/mounts.h
91594d
@@ -182,7 +182,7 @@ int tree_mapent_add_node(struct mapent_c
91594d
 int tree_mapent_delete_offsets(struct mapent_cache *mc, const char *key);
91594d
 void tree_mapent_cleanup_offsets(struct mapent *oe);
91594d
 int tree_mapent_mount_offsets(struct mapent *oe, int nonstrict);
91594d
-int tree_mapent_umount_offsets(struct mapent *oe, int nonstrict);
91594d
+int tree_mapent_umount_offsets(struct mapent *oe);
91594d
 int unlink_mount_tree(struct autofs_point *ap, const char *mp);
91594d
 void free_mnt_list(struct mnt_list *list);
91594d
 int is_mounted(const char *mp, unsigned int type);
91594d
--- autofs-5.1.7.orig/lib/mounts.c
91594d
+++ autofs-5.1.7/lib/mounts.c
91594d
@@ -1843,7 +1843,7 @@ static int tree_mapent_umount_offset(str
91594d
 	 * Check for and umount subtree offsets resulting from
91594d
 	 * nonstrict mount fail.
91594d
 	 */
91594d
-	ret = tree_mapent_umount_offsets(oe, ctxt->strict);
91594d
+	ret = tree_mapent_umount_offsets(oe);
91594d
 	if (!ret)
91594d
 		return 0;
91594d
 
91594d
@@ -1975,14 +1975,14 @@ static int tree_mapent_umount_offsets_wo
91594d
 	return tree_mapent_umount_offset(oe, ptr);
91594d
 }
91594d
 
91594d
-int tree_mapent_umount_offsets(struct mapent *oe, int nonstrict)
91594d
+int tree_mapent_umount_offsets(struct mapent *oe)
91594d
 {
91594d
 	struct tree_node *base = MAPENT_NODE(oe);
91594d
 	struct autofs_point *ap = oe->mc->ap;
91594d
 	struct traverse_subtree_context ctxt = {
91594d
 		.ap = ap,
91594d
 		.base = base,
91594d
-		.strict = !nonstrict,
91594d
+		.strict = 1,
91594d
 	};
91594d
 	int ret;
91594d