autofs-5.1.8 - fix fix root offset error handling

From: Ian Kent <raven@themaw.net>

The change to fix root offset error handlling is missing a cache read
lock prior to the key lookup, the following unmatched unlock then
causes a hang.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG       |    1 +
 daemon/direct.c |    1 +
 2 files changed, 2 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 6f18a0bb..f81b0259 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@
 - fix set open file limit.
 - improve descriptor open error reporting.
 - fix root offset error handling.
+- fix fix root offset error handling.
 
 19/10/2021 autofs-5.1.8
 - add xdr_exports().
diff --git a/daemon/direct.c b/daemon/direct.c
index 8810900c..cf3f24d7 100644
--- a/daemon/direct.c
+++ b/daemon/direct.c
@@ -1275,6 +1275,7 @@ static void *do_mount_direct(void *arg)
 		/* If this is a multi-mount subtree mount failure
 		 * ensure the tree continues to expire.
 		 */
+		cache_readlock(mt.mc);
 		me = cache_lookup_distinct(mt.mc, mt.name);
 		if (me && IS_MM(me) && !IS_MM_ROOT(me))
 			conditional_alarm_add(ap, ap->exp_runfreq);