summaryrefslogtreecommitdiff
path: root/lib/btrfs
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-04-17 15:53:42 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-04-17 19:52:26 -0600
commit1a979d52855911980acc0b6f366d808c5734c054 (patch)
tree3969f799dca5bb22262359927dd7a1ac8e963004 /lib/btrfs
parent5e7fe4c3d25fdecb3b5d4ad5f752fb0a6bddac85 (diff)
btrfstree: Wrap the error for UUID lookup failures
Diffstat (limited to 'lib/btrfs')
-rw-r--r--lib/btrfs/btrfstree/btree_tree.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/btrfs/btrfstree/btree_tree.go b/lib/btrfs/btrfstree/btree_tree.go
index b9b9201..b071b7d 100644
--- a/lib/btrfs/btrfstree/btree_tree.go
+++ b/lib/btrfs/btrfstree/btree_tree.go
@@ -328,7 +328,8 @@ func (tree *RawTree) TreeParentID(ctx context.Context) (btrfsprim.ObjID, btrfspr
}
parentIDItem, err := uuidTree.TreeLookup(ctx, btrfsitem.UUIDToKey(tree.ParentUUID))
if err != nil {
- return 0, 0, err
+ return 0, 0, fmt.Errorf("tree %s: failed to look up UUID: %v: %w",
+ tree.ID.Format(btrfsprim.ROOT_TREE_OBJECTID), tree.ParentUUID, err)
}
switch parentIDBody := parentIDItem.Body.(type) {
case *btrfsitem.UUIDMap: