Blame SOURCES/autofs-5.1.7-fix-amd-hosts-mount-expire.patch

29d2b9
autofs-5.1.7 - fix amd hosts mount expire
29d2b9
29d2b9
From: Ian Kent <raven@themaw.net>
29d2b9
29d2b9
When swicthing to use the mnt_list to track mounts for expire, if the
29d2b9
amd hosts map entry name is for the host short name, the amd mount
29d2b9
entry for the short name gets removed. This causes a subsequent mounts
29d2b9
for host exports to fail.
29d2b9
29d2b9
What should happen is the short name amd entry not be removed and a
29d2b9
mounted mount entry for the symlinked FQDN mount added so it expires.
29d2b9
29d2b9
Signed-off-by: Ian Kent <raven@themaw.net>
29d2b9
---
29d2b9
 CHANGELOG           |    1 +
29d2b9
 modules/parse_amd.c |    9 +++++----
29d2b9
 2 files changed, 6 insertions(+), 4 deletions(-)
29d2b9
29d2b9
--- autofs-5.1.7.orig/CHANGELOG
29d2b9
+++ autofs-5.1.7/CHANGELOG
29d2b9
@@ -68,6 +68,7 @@
29d2b9
 - add ext_mount_hash_mutex lock helpers.
29d2b9
 - fix dangling symlink creation if nis support is not available.
29d2b9
 - fix amd section mounts map reload.
29d2b9
+- fix amd hosts mount expire.
29d2b9
 
29d2b9
 25/01/2021 autofs-5.1.7
29d2b9
 - make bind mounts propagation slave by default.
29d2b9
--- autofs-5.1.7.orig/modules/parse_amd.c
29d2b9
+++ autofs-5.1.7/modules/parse_amd.c
29d2b9
@@ -2341,12 +2341,13 @@ int parse_mount(struct autofs_point *ap,
29d2b9
 		if (!rv) {
29d2b9
 			/*
29d2b9
 			 * If entry->path doesn't match the mnt->mp then
29d2b9
-			 * the mount point path has changed and a new
29d2b9
-			 * mnt_list entry added for it, so remove the
29d2b9
-			 * original.
29d2b9
+			 * it's a "host" map and the mount point path is
29d2b9
+			 * different to the lookup name. Add a new mnt_list
29d2b9
+			 * entry so that both the symlinked name and the
29d2b9
+			 * mount expire.
29d2b9
 			 */
29d2b9
 			if (strcmp(this->path, mnt->mp))
29d2b9
-				mnts_remove_amdmount(this->path);
29d2b9
+				mnts_add_mount(ap, this->rhost, MNTS_INDIRECT|MNTS_MOUNTED);
29d2b9
 			break;
29d2b9
 		}
29d2b9
 		/* Not mounted, remove the mnt_list entry from amdmount list */