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

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