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