Blame SOURCES/autofs-5.0.9-amd-lookup-try-to-use-external-mounts-for-real-mounts.patch

4d476f
autofs-5.0.9 - amd lookup try to use external mounts for real mounts
4d476f
4d476f
From: Ian Kent <ikent@redhat.com>
4d476f
4d476f
When using generic type mounts they may point to user mounted
4d476f
external mounts which doesn't need to be mounted or umounted.
4d476f
4d476f
The current usage doesn't always use external mounts which isn't
4d476f
quite right so, if option fs is defined use, an external.
4d476f
---
4d476f
 modules/parse_amd.c |    9 +++++++--
4d476f
 1 file changed, 7 insertions(+), 2 deletions(-)
4d476f
4d476f
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
4d476f
index 410f6ff..790f25e 100644
4d476f
--- a/modules/parse_amd.c
4d476f
+++ b/modules/parse_amd.c
4d476f
@@ -970,7 +970,7 @@ static int do_generic_mount(struct autofs_point *ap, const char *name,
4d476f
 	unsigned int umount = 0;
4d476f
 	int ret = 0;
4d476f
 
4d476f
-	if (!entry->sublink) {
4d476f
+	if (!entry->fs) {
4d476f
 		ret = do_mount(ap, ap->path, name, strlen(name),
4d476f
 			       target, entry->type, entry->opts);
4d476f
 	} else {
4d476f
@@ -986,7 +986,7 @@ static int do_generic_mount(struct autofs_point *ap, const char *name,
4d476f
 				goto out;
4d476f
 			umount = 1;
4d476f
 		}
4d476f
-		/* We might be using an external mount */
4d476f
+		/* We have an external mount */
4d476f
 		ext_mount_add(&entry->ext_mount, entry->fs, umount);
4d476f
 		ret = do_link_mount(ap, name, entry, flags);
4d476f
 	}
4d476f
@@ -1237,6 +1237,11 @@ static unsigned int validate_generic_options(unsigned int logopt,
4d476f
 			return 0;
4d476f
 		}
4d476f
 	}
4d476f
+	if (entry->sublink && !entry->fs) {
4d476f
+		error(logopt, MODPREFIX
4d476f
+		      "%s: sublink option requires option fs");
4d476f
+		return 0;
4d476f
+	}
4d476f
 	return 1;
4d476f
 }
4d476f