autofs-5.1.9 - skip expire check for amd nounmount mounts

From: Ian Kent <raven@themaw.net>

There's no need to check amd mounts with the "nounmount" option set.

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

diff --git a/CHANGELOG b/CHANGELOG
index c52f91123..bd55a2f8f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -81,6 +81,7 @@
 - add function table_lookup_ino().
 - improve handling of missing map entry for mount request.
 - fix incorrect flags update in update_with_defaults().
+- skip expire check for amd nounmount mounts.
 
 02/11/2023 autofs-5.1.9
 - fix kernel mount status notification.
diff --git a/daemon/indirect.c b/daemon/indirect.c
index 0e81360b4..bb6377344 100644
--- a/daemon/indirect.c
+++ b/daemon/indirect.c
@@ -377,6 +377,11 @@ void *expire_proc_indirect(void *arg)
 		char *ind_key;
 		int ret;
 
+		/* No need to check "nounmount" amd mounts */
+		if (mnt->flags & MNTS_AMD_MOUNT &&
+		    mnt->amd_flags & AMD_MOUNT_OPT_NOUNMOUNT)
+			continue;
+
 		if (mnt->flags & (MNTS_AUTOFS|MNTS_OFFSET)) {
 			/*
 			 * If we have submounts check if this path lives below
