autofs-5.1.9 make mnts_has_mounted_mounts() check submounts

From: Ian Kent <raven@themaw.net>

The function mnts_has_mounted_mounts() should also check if the mount
has submounts when conditionally setting the expire alarm.

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

diff --git a/CHANGELOG b/CHANGELOG
index 9a8e893c6..52f33288f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -40,6 +40,7 @@
 - fix uninitialised list in struct master_mapent.
 - fix tsv memory leak in set_tsd_user_vars().
 - fix dont delay expire.
+- make mnts_has_mounted_mounts() check submounts.
 
 02/11/2023 autofs-5.1.9
 - fix kernel mount status notification.
diff --git a/lib/mounts.c b/lib/mounts.c
index 1f0bea53b..662a2a8b2 100644
--- a/lib/mounts.c
+++ b/lib/mounts.c
@@ -1340,7 +1340,7 @@ unsigned int mnts_has_mounted_mounts(struct autofs_point *ap)
 	unsigned int has_mounted_mounts = 0;
 
 	mnts_hash_mutex_lock();
-	if (list_empty(&ap->mounts))
+	if (list_empty(&ap->mounts) && list_empty(&ap->submounts))
 		goto done;
 	has_mounted_mounts = 1;
 done:
