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

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