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

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