From 825fe95475952b18fc586630de5ddaf3faacbde7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 9 Apr 2023 12:13:58 -0600 Subject: btrfsutil: RebuiltForrest: Don't bother listing trees with no roots --- lib/btrfsutil/rebuilt_forrest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/btrfsutil') diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go index ba88bbc..6231563 100644 --- a/lib/btrfsutil/rebuilt_forrest.go +++ b/lib/btrfsutil/rebuilt_forrest.go @@ -278,7 +278,7 @@ func (ts *RebuiltForrest) RebuiltListRoots(ctx context.Context) map[btrfsprim.Ob defer ts.treesMu.Unlock() ret := make(map[btrfsprim.ObjID]containers.Set[btrfsvol.LogicalAddr]) for treeID, tree := range ts.trees { - if tree != nil { + if tree != nil && len(tree.Roots) > 0 { ret[treeID] = tree.Roots } } -- cgit v1.2.3-2-g168b