Blame SOURCES/autofs-5.1.7-fix-mnts_get_expire_list-expire-list-construction.patch

96dc52
autofs-5.1.7 - fix mnts_get_expire_list() expire list construction
96dc52
96dc52
From: Ian Kent <raven@themaw.net>
96dc52
96dc52
The mnts_get_expire_list() function is supposed to return an ordered
96dc52
list of expire candidates but it is not checking the mounted status
96dc52
of list entries and is returning a larger list than is needed.
96dc52
96dc52
Signed-off-by: Ian Kent <raven@themaw.net>
96dc52
---
96dc52
 CHANGELOG    |    1 +
96dc52
 lib/mounts.c |    3 +++
96dc52
 2 files changed, 4 insertions(+)
96dc52
96dc52
diff --git a/CHANGELOG b/CHANGELOG
96dc52
index f5c5641a..1dded118 100644
96dc52
--- a/CHANGELOG
96dc52
+++ b/CHANGELOG
96dc52
@@ -14,6 +14,7 @@
96dc52
 - refactor umount_multi_triggers().
96dc52
 - eliminate clean_stale_multi_triggers().
96dc52
 - simplify mount_subtree() mount check.
96dc52
+- fix mnts_get_expire_list() expire list construction.
96dc52
 
96dc52
 25/01/2021 autofs-5.1.7
96dc52
 - make bind mounts propagation slave by default.
96dc52
diff --git a/lib/mounts.c b/lib/mounts.c
96dc52
index a9abbebf..87813b16 100644
96dc52
--- a/lib/mounts.c
96dc52
+++ b/lib/mounts.c
96dc52
@@ -1364,6 +1364,9 @@ void mnts_get_expire_list(struct list_head *mnts, struct autofs_point *ap)
96dc52
 	list_for_each_entry(mnt, &ap->mounts, mount) {
96dc52
 		struct node *n;
96dc52
 
96dc52
+		if (!(mnt->flags & MNTS_MOUNTED))
96dc52
+			continue;
96dc52
+
96dc52
 		__mnts_get_mount(mnt);
96dc52
 
96dc52
 		if (!tree) {