Blame SOURCES/autofs-5.1.7-pass-mapent_cache-to-update_offset_entry.patch

96dc52
autofs-5.1.7 - pass mapent_cache to update_offset_entry()
96dc52
96dc52
From: Ian Kent <raven@themaw.net>
96dc52
96dc52
Pass mapent_cache to update_offset_entry() rather than use the wait/signal
96dc52
mechanism, it isn't needed here.
96dc52
96dc52
Signed-off-by: Ian Kent <raven@themaw.net>
96dc52
---
96dc52
 CHANGELOG           |    1 +
96dc52
 modules/parse_sun.c |   22 ++++++----------------
96dc52
 2 files changed, 7 insertions(+), 16 deletions(-)
96dc52
96dc52
diff --git a/CHANGELOG b/CHANGELOG
96dc52
index 6e0edd74..c60a9ed3 100644
96dc52
--- a/CHANGELOG
96dc52
+++ b/CHANGELOG
96dc52
@@ -17,6 +17,7 @@
96dc52
 - fix mnts_get_expire_list() expire list construction.
96dc52
 - fix inconsistent locking in umount_subtree_mounts().
96dc52
 - fix return from umount_subtree_mounts() on offset list delete.
96dc52
+- pass mapent_cache to update_offset_entry().
96dc52
 
96dc52
 25/01/2021 autofs-5.1.7
96dc52
 - make bind mounts propagation slave by default.
96dc52
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
96dc52
index 1142e8a3..95251bee 100644
96dc52
--- a/modules/parse_sun.c
96dc52
+++ b/modules/parse_sun.c
96dc52
@@ -793,24 +793,17 @@ static int check_is_multi(const char *mapent)
96dc52
 }
96dc52
 
96dc52
 static int
96dc52
-update_offset_entry(struct autofs_point *ap, const char *name,
96dc52
+update_offset_entry(struct autofs_point *ap,
96dc52
+		    struct mapent_cache *mc, const char *name,
96dc52
 		    const char *m_root, int m_root_len,
96dc52
-		    const char *path, const char *myoptions, const char *loc,
96dc52
-		    time_t age)
96dc52
+		    const char *path, const char *myoptions,
96dc52
+		    const char *loc, time_t age)
96dc52
 {
96dc52
-	struct map_source *source;
96dc52
-	struct mapent_cache *mc;
96dc52
 	char m_key[PATH_MAX + 1];
96dc52
 	char m_mapent[MAPENT_MAX_LEN + 1];
96dc52
 	int p_len, m_key_len, m_options_len, m_mapent_len;
96dc52
 	int ret;
96dc52
 
96dc52
-	source = ap->entry->current;
96dc52
-	ap->entry->current = NULL;
96dc52
-	master_source_current_signal(ap->entry);
96dc52
-
96dc52
-	mc = source->mc;
96dc52
-
96dc52
 	memset(m_mapent, 0, MAPENT_MAX_LEN + 1);
96dc52
 
96dc52
 	/* Internal hosts map may have loc == NULL */
96dc52
@@ -1574,11 +1567,8 @@ dont_expand:
96dc52
 			p += l;
96dc52
 			p = skipspace(p);
96dc52
 
96dc52
-			master_source_current_wait(ap->entry);
96dc52
-			ap->entry->current = source;
96dc52
-
96dc52
-			status = update_offset_entry(ap, name,
96dc52
-						     m_root, m_root_len,
96dc52
+			status = update_offset_entry(ap, mc,
96dc52
+						     name, m_root, m_root_len,
96dc52
 						     path, myoptions, loc, age);
96dc52
 
96dc52
 			if (status != CHE_OK) {