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

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