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

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