summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-04-09 12:13:58 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-04-09 12:13:58 -0600
commit825fe95475952b18fc586630de5ddaf3faacbde7 (patch)
treeb642012aea806b794f6e7141dbc3a57d8f67bebc
parent86f83b75c73d9eb2e1f8733a02ce12c58f563530 (diff)
btrfsutil: RebuiltForrest: Don't bother listing trees with no roots
-rw-r--r--lib/btrfsutil/rebuilt_forrest.go2
1 files changed, 1 insertions, 1 deletions
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
}
}