Blame SOURCES/autofs-5.1.8-fix-parse-module-instance-mutex-naming.patch

591f3a
autofs-5.1.8 - fix parse module instance mutex naming
591f3a
591f3a
From: Ian Kent <raven@themaw.net>
591f3a
591f3a
The naming used for parse module instance locks is the same as that
591f3a
used for map lookup instances. Rename these to make it clear they
591f3a
are being used in the parse modules.
591f3a
591f3a
Signed-off-by: Ian Kent <raven@themaw.net>
591f3a
---
591f3a
 CHANGELOG           |    1 +
591f3a
 modules/parse_amd.c |   28 ++++++++++++++--------------
591f3a
 modules/parse_sun.c |   20 ++++++++++----------
591f3a
 3 files changed, 25 insertions(+), 24 deletions(-)
591f3a
591f3a
--- autofs-5.1.4.orig/CHANGELOG
591f3a
+++ autofs-5.1.4/CHANGELOG
591f3a
@@ -96,6 +96,7 @@
591f3a
 - fix handling of incorrect return from umount_ent().
591f3a
 - dont use initgroups() at spawn.
591f3a
 - fix invalid tsv access.
591f3a
+- fix parse module instance mutex naming.
591f3a
 
591f3a
 xx/xx/2018 autofs-5.1.5
591f3a
 - fix flag file permission.
591f3a
--- autofs-5.1.4.orig/modules/parse_amd.c
591f3a
+++ autofs-5.1.4/modules/parse_amd.c
591f3a
@@ -39,18 +39,18 @@ int parse_version = AUTOFS_PARSE_VERSION
591f3a
 
591f3a
 static struct mount_mod *mount_nfs = NULL;
591f3a
 static int init_ctr = 0;
591f3a
-static pthread_mutex_t instance_mutex = PTHREAD_MUTEX_INITIALIZER;
591f3a
+static pthread_mutex_t parse_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
591f3a
 
591f3a
-static void instance_mutex_lock(void)
591f3a
+static void parse_instance_mutex_lock(void)
591f3a
 {
591f3a
-	int status = pthread_mutex_lock(&instance_mutex);
591f3a
+	int status = pthread_mutex_lock(&parse_instance_mutex);
591f3a
 	if (status)
591f3a
 		fatal(status);
591f3a
 }
591f3a
 
591f3a
-static void instance_mutex_unlock(void)
591f3a
+static void parse_instance_mutex_unlock(void)
591f3a
 {
591f3a
-	int status = pthread_mutex_unlock(&instance_mutex);
591f3a
+	int status = pthread_mutex_unlock(&parse_instance_mutex);
591f3a
 	if (status)
591f3a
 		fatal(status);
591f3a
 }
591f3a
@@ -112,7 +112,7 @@ int parse_init(int argc, const char *con
591f3a
 
591f3a
 	/* We only need this once.  NFS mounts are so common that we cache
591f3a
 	   this module. */
591f3a
-	instance_mutex_lock();
591f3a
+	parse_instance_mutex_lock();
591f3a
 	if (mount_nfs)
591f3a
 		init_ctr++;
591f3a
 	else {
591f3a
@@ -121,11 +121,11 @@ int parse_init(int argc, const char *con
591f3a
 		} else {
591f3a
 			kill_context(ctxt);
591f3a
 			*context = NULL;
591f3a
-			instance_mutex_unlock();
591f3a
+			parse_instance_mutex_unlock();
591f3a
 			return 1;
591f3a
 		}
591f3a
 	}
591f3a
-	instance_mutex_unlock();
591f3a
+	parse_instance_mutex_unlock();
591f3a
 
591f3a
 	return 0;
591f3a
 }
591f3a
@@ -1358,11 +1358,11 @@ static int do_host_mount(struct autofs_p
591f3a
 		argc = 1;
591f3a
 	}
591f3a
 
591f3a
-	instance_mutex_lock();
591f3a
+	parse_instance_mutex_lock();
591f3a
 	status = open_lookup("hosts", MODPREFIX, NULL, argc, pargv, &lookup);
591f3a
 	if (status != NSS_STATUS_SUCCESS) {
591f3a
 		debug(ap->logopt, "open lookup module hosts failed");
591f3a
-		instance_mutex_unlock();
591f3a
+		parse_instance_mutex_unlock();
591f3a
 		goto out;
591f3a
 	}
591f3a
 
591f3a
@@ -1374,13 +1374,13 @@ static int do_host_mount(struct autofs_p
591f3a
 		if (!instance) {
591f3a
 			error(ap->logopt, MODPREFIX
591f3a
 			     "failed to create source instance for hosts map");
591f3a
-			instance_mutex_unlock();
591f3a
+			parse_instance_mutex_unlock();
591f3a
 			close_lookup(lookup);
591f3a
 			goto out;
591f3a
 		}
591f3a
 	}
591f3a
 	instance->lookup = lookup;
591f3a
-	instance_mutex_unlock();
591f3a
+	parse_instance_mutex_unlock();
591f3a
 
591f3a
 	cache_writelock(source->mc);
591f3a
 	me = cache_lookup_distinct(source->mc, name);
591f3a
@@ -2373,12 +2373,12 @@ int parse_done(void *context)
591f3a
 	int rv = 0;
591f3a
 	struct parse_context *ctxt = (struct parse_context *) context;
591f3a
 
591f3a
-	instance_mutex_lock();
591f3a
+	parse_instance_mutex_lock();
591f3a
 	if (--init_ctr == 0) {
591f3a
 		rv = close_mount(mount_nfs);
591f3a
 		mount_nfs = NULL;
591f3a
 	}
591f3a
-	instance_mutex_unlock();
591f3a
+	parse_instance_mutex_unlock();
591f3a
 	if (ctxt)
591f3a
 		kill_context(ctxt);
591f3a
 
591f3a
--- autofs-5.1.4.orig/modules/parse_sun.c
591f3a
+++ autofs-5.1.4/modules/parse_sun.c
591f3a
@@ -41,18 +41,18 @@ int parse_version = AUTOFS_PARSE_VERSION
591f3a
 
591f3a
 static struct mount_mod *mount_nfs = NULL;
591f3a
 static int init_ctr = 0;
591f3a
-static pthread_mutex_t instance_mutex = PTHREAD_MUTEX_INITIALIZER;
591f3a
+static pthread_mutex_t parse_instance_mutex = PTHREAD_MUTEX_INITIALIZER;
591f3a
 
591f3a
-static void instance_mutex_lock(void)
591f3a
+static void parse_instance_mutex_lock(void)
591f3a
 {
591f3a
-	int status = pthread_mutex_lock(&instance_mutex);
591f3a
+	int status = pthread_mutex_lock(&parse_instance_mutex);
591f3a
 	if (status)
591f3a
 		fatal(status);
591f3a
 }
591f3a
 
591f3a
-static void instance_mutex_unlock(void)
591f3a
+static void parse_instance_mutex_unlock(void)
591f3a
 {
591f3a
-	int status = pthread_mutex_unlock(&instance_mutex);
591f3a
+	int status = pthread_mutex_unlock(&parse_instance_mutex);
591f3a
 	if (status)
591f3a
 		fatal(status);
591f3a
 }
591f3a
@@ -423,7 +423,7 @@ int parse_init(int argc, const char *con
591f3a
 
591f3a
 	/* We only need this once.  NFS mounts are so common that we cache
591f3a
 	   this module. */
591f3a
-	instance_mutex_lock();
591f3a
+	parse_instance_mutex_lock();
591f3a
 	if (mount_nfs)
591f3a
 		init_ctr++;
591f3a
 	else {
591f3a
@@ -431,11 +431,11 @@ int parse_init(int argc, const char *con
591f3a
 			init_ctr++;
591f3a
 		} else {
591f3a
 			kill_context(ctxt);
591f3a
-			instance_mutex_unlock();
591f3a
+			parse_instance_mutex_unlock();
591f3a
 			return 1;
591f3a
 		}
591f3a
 	}
591f3a
-	instance_mutex_unlock();
591f3a
+	parse_instance_mutex_unlock();
591f3a
 
591f3a
 	*context = (void *) ctxt;
591f3a
 
591f3a
@@ -1719,12 +1719,12 @@ int parse_done(void *context)
591f3a
 	int rv = 0;
591f3a
 	struct parse_context *ctxt = (struct parse_context *) context;
591f3a
 
591f3a
-	instance_mutex_lock();
591f3a
+	parse_instance_mutex_lock();
591f3a
 	if (--init_ctr == 0) {
591f3a
 		rv = close_mount(mount_nfs);
591f3a
 		mount_nfs = NULL;
591f3a
 	}
591f3a
-	instance_mutex_unlock();
591f3a
+	parse_instance_mutex_unlock();
591f3a
 	if (ctxt)
591f3a
 		kill_context(ctxt);
591f3a