summaryrefslogtreecommitdiff
path: root/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go')
-rw-r--r--cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go
index cfef623..b8205ae 100644
--- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go
+++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go
@@ -37,7 +37,7 @@ func (o forrestCallbacks) AddedRoot(_ context.Context, tree btrfsprim.ObjID, _ b
}
// LookupRoot implements btrfsutil.RebuiltForrestCallbacks.
-func (o forrestCallbacks) LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, _item btrfsitem.Root, ok bool) {
+func (o forrestCallbacks) LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offset btrfsprim.Generation, _item btrfsitem.Root, err error) {
wantKey := wantWithTree{
TreeID: btrfsprim.ROOT_TREE_OBJECTID,
Key: want{
@@ -50,16 +50,16 @@ func (o forrestCallbacks) LookupRoot(ctx context.Context, tree btrfsprim.ObjID)
foundKey, ok := o._want(ctx, wantKey)
if !ok {
o.enqueueRetry(btrfsprim.ROOT_TREE_OBJECTID)
- return 0, btrfsitem.Root{}, false
+ return 0, btrfsitem.Root{}, btrfstree.ErrNoItem
}
item, _ := discardErr(o.rebuilt.RebuiltTree(ctx, wantKey.TreeID)).TreeLookup(ctx, foundKey)
defer item.Body.Free()
switch itemBody := item.Body.(type) {
case *btrfsitem.Root:
- return btrfsprim.Generation(foundKey.Offset), *itemBody, true
+ return btrfsprim.Generation(foundKey.Offset), *itemBody, nil
case *btrfsitem.Error:
graphCallbacks(o).FSErr(ctx, fmt.Errorf("error decoding item: %v: %w", foundKey, itemBody.Err))
- return 0, btrfsitem.Root{}, false
+ return 0, btrfsitem.Root{}, itemBody.Err
default:
// This is a panic because the item decoder should not emit ROOT_ITEM items as anything but
// btrfsitem.Root or btrfsitem.Error without this code also being updated.