summaryrefslogtreecommitdiff
path: root/lib/btrfsutil/rebuilt_forrest.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-04-17 18:21:04 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-04-17 19:52:26 -0600
commit6b521d08bbb75430432834e5fcd2cb1da3de1e2e (patch)
tree89a729827ca956234cea97269e12c0859b8fb08f /lib/btrfsutil/rebuilt_forrest.go
parent3a7fec8e6fe4d36c976540f88bce2c186dd47d1f (diff)
btrfsutil: RebuiltForrest: Have LookupRoot return an error
Diffstat (limited to 'lib/btrfsutil/rebuilt_forrest.go')
-rw-r--r--lib/btrfsutil/rebuilt_forrest.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go
index 3c53af7..3e40103 100644
--- a/lib/btrfsutil/rebuilt_forrest.go
+++ b/lib/btrfsutil/rebuilt_forrest.go
@@ -212,9 +212,9 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI
sb, _ := ts.Superblock()
ts.trees[treeID].Root = sb.BlockGroupRoot
default:
- rootOff, rootItem, ok := ts.cb.LookupRoot(ctx, treeID)
- if !ok {
- ts.trees[treeID].rootErr = btrfstree.ErrNoTree
+ rootOff, rootItem, err := ts.cb.LookupRoot(ctx, treeID)
+ if err != nil {
+ ts.trees[treeID].rootErr = fmt.Errorf("%w: %s", btrfstree.ErrNoTree, err)
return
}
ts.trees[treeID].Root = rootItem.ByteNr