summaryrefslogtreecommitdiff
path: root/lib/btrfsutil/rebuilt_forrest.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfsutil/rebuilt_forrest.go')
-rw-r--r--lib/btrfsutil/rebuilt_forrest.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go
index 3e40103..79d8beb 100644
--- a/lib/btrfsutil/rebuilt_forrest.go
+++ b/lib/btrfsutil/rebuilt_forrest.go
@@ -214,7 +214,8 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI
default:
rootOff, rootItem, err := ts.cb.LookupRoot(ctx, treeID)
if err != nil {
- ts.trees[treeID].rootErr = fmt.Errorf("%w: %s", btrfstree.ErrNoTree, err)
+ ts.trees[treeID].rootErr = fmt.Errorf("tree %s: %w: %s",
+ treeID.Format(btrfsprim.ROOT_TREE_OBJECTID), btrfstree.ErrNoTree, err)
return
}
ts.trees[treeID].Root = rootItem.ByteNr
@@ -223,7 +224,8 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI
ts.trees[treeID].ParentGen = rootOff
parentID, err := ts.cb.LookupUUID(ctx, rootItem.ParentUUID)
if err != nil {
- err := fmt.Errorf("failed to look up UUID: %v: %w", rootItem.ParentUUID, err)
+ err := fmt.Errorf("tree %s: failed to look up UUID: %v: %w",
+ treeID.Format(btrfsprim.ROOT_TREE_OBJECTID), rootItem.ParentUUID, err)
if ts.laxAncestors {
ts.trees[treeID].parentErr = err
} else {
@@ -238,7 +240,8 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI
ts.trees[treeID].ancestorLoop = true
return
case !ts.laxAncestors && ts.trees[treeID].Parent.rootErr != nil:
- ts.trees[treeID].rootErr = fmt.Errorf("failed to rebuild parent tree: %v: %w", parentID, ts.trees[treeID].Parent.rootErr)
+ ts.trees[treeID].rootErr = fmt.Errorf("tree %s: failed to rebuild parent: %w",
+ treeID.Format(btrfsprim.ROOT_TREE_OBJECTID), ts.trees[treeID].Parent.rootErr)
return
}
}