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

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