From 72b86f4fa218c4425cfe70f8e800cb7152c83b5e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 14 Mar 2023 21:38:37 -0600 Subject: btrfs: Have "missing by-name direntry" errors be in a stable order --- lib/btrfs/io4_fs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/btrfs/io4_fs.go b/lib/btrfs/io4_fs.go index 56cf266..749b2de 100644 --- a/lib/btrfs/io4_fs.go +++ b/lib/btrfs/io4_fs.go @@ -292,7 +292,8 @@ func (dir *Dir) populate() { } entriesWithIndexes := make(containers.Set[string]) nextIndex := uint64(2) - for index, entry := range dir.ChildrenByIndex { + for _, index := range maps.SortedKeys(dir.ChildrenByIndex) { + entry := dir.ChildrenByIndex[index] if index+1 > nextIndex { nextIndex = index + 1 } -- cgit v1.2.3-2-g168b