autofs/autofs-5.1.7-fix-mnts_get_expire_list-expire-list-construction.patch
DistroBaker a5adb69dac Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/autofs.git#25aaf0b69441b4e7370a195cbf1c7988d0abef3d
2021-03-26 02:05:45 +00:00

41 lines
1.2 KiB
Diff

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