autofs/SOURCES/autofs-5.1.8-remove-nonstrict-parameter-from-tree_mapent_umount_offsets.patch
2022-03-30 15:40:13 +00:00

78 lines
2.6 KiB
Diff

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