diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-04 10:46:02 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-04 13:17:11 -0600 |
commit | acd2813582fb2e463780149eebe655d5070f204b (patch) | |
tree | 01cb01e76eaf75fe3e5e35b5cc9e3df6109dd6aa /lib/btrfsutil/old_rebuilt_forrest.go | |
parent | f052b73806bd417aa9548bfb9bf71ae64338ffa0 (diff) |
btrfsutil: OldRebuiltTree: Include the node address in errors
Diffstat (limited to 'lib/btrfsutil/old_rebuilt_forrest.go')
-rw-r--r-- | lib/btrfsutil/old_rebuilt_forrest.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/btrfsutil/old_rebuilt_forrest.go b/lib/btrfsutil/old_rebuilt_forrest.go index 9035b98..c451fb8 100644 --- a/lib/btrfsutil/old_rebuilt_forrest.go +++ b/lib/btrfsutil/old_rebuilt_forrest.go @@ -35,13 +35,14 @@ type oldRebuiltTree struct { var _ btrfstree.Tree = oldRebuiltTree{} type oldRebuiltTreeError struct { - Min btrfsprim.Key - Max btrfsprim.Key - Err error + Min btrfsprim.Key + Max btrfsprim.Key + Node btrfsvol.LogicalAddr + Err error } func (e oldRebuiltTreeError) Error() string { - return fmt.Sprintf("keys %v-%v: %v", e.Min, e.Max, e.Err) + return fmt.Sprintf("keys %v-%v: node@%v: %v", e.Min, e.Max, e.Node, e.Err) } func (e oldRebuiltTreeError) Unwrap() error { @@ -189,11 +190,12 @@ func (bt *OldRebuiltForrest) rawTreeWalk(ctx context.Context, treeID btrfsprim.O var curNode nodeInfo cbs := btrfstree.TreeWalkHandler{ BadNode: func(path btrfstree.Path, node *btrfstree.Node, err error) bool { - _, nodeExp, _ := path.NodeExpectations(ctx, false) + nodeAddr, nodeExp, _ := path.NodeExpectations(ctx, false) cacheEntry.Errors.Insert(oldRebuiltTreeError{ - Min: nodeExp.MinItem.Val, - Max: nodeExp.MaxItem.Val, - Err: err, + Min: nodeExp.MinItem.Val, + Max: nodeExp.MaxItem.Val, + Node: nodeAddr, + Err: err, }) return false }, |