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

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