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

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