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

4d476f
autofs-5.0.9 - amd lookup try to use external mounts for nfs mounts
4d476f
4d476f
From: Ian Kent <raven@themaw.net>
4d476f
4d476f
When using nfs type mounts they may be mounted externally to avoid
4d476f
multiple instances of the mount.
4d476f
4d476f
The current usage doesn't always use external mounts when it can so,
4d476f
if option fs is defined, use an external.
4d476f
---
4d476f
 modules/parse_amd.c |    7 ++++++-
4d476f
 1 file changed, 6 insertions(+), 1 deletion(-)
4d476f
4d476f
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
4d476f
index 0c708e6..becc519 100644
4d476f
--- a/modules/parse_amd.c
4d476f
+++ b/modules/parse_amd.c
4d476f
@@ -1011,7 +1011,7 @@ static int do_nfs_mount(struct autofs_point *ap, const char *name,
4d476f
 	if (proximity == PROXIMITY_OTHER && entry->remopts)
4d476f
 		opts = entry->remopts;
4d476f
 
4d476f
-	if (!entry->sublink) {
4d476f
+	if (!entry->fs) {
4d476f
 		ret = mount_nfs->mount_mount(ap, ap->path, name, strlen(name),
4d476f
 					     target, entry->type, opts,
4d476f
 					     mount_nfs->context);
4d476f
@@ -1214,6 +1214,11 @@ static unsigned int validate_nfs_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