From 9a319a9b4f0a1e4311c3457ac7be20f74cb3e19c Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 15 Feb 2022 14:53:24 +0100 Subject: [PATCH] sys/vfs: Iterate over file systems in sequence This is a cosmetic change when considering vfs_iterate_mounts alone (which now reports FSs in precise mount order rather than reporting the most recently mounted, followed by the rest in mount order), but is helpful for uses of it that need some guarantees in order to produce reliable results even when iteration and (un)mounting interact. --- sys/vfs/vfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vfs/vfs.c b/sys/vfs/vfs.c index 227e087b88..fdc91bfd56 100644 --- a/sys/vfs/vfs.c +++ b/sys/vfs/vfs.c @@ -896,10 +896,11 @@ const vfs_mount_t *vfs_iterate_mounts(const vfs_mount_t *cur) /* empty list */ return NULL; } + node = node->next; } else { node = cur->list_entry.next; - if (node == _vfs_mounts_list.next) { + if (node == _vfs_mounts_list.next->next) { return NULL; } }