summaryrefslogtreecommitdiff
path: root/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-12-23 19:54:56 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2022-12-23 19:57:21 -0700
commitb3264cfa1a48998bc9406c18339801c21a468f05 (patch)
tree0215f3c1a967d039538de9ddd9c20949eb794646 /lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
parent5fcb6f7ab77721faf0f89e00bf3087baba2d566c (diff)
rebuildnodes: Less noisy logging about csums
Diffstat (limited to 'lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go')
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
index 076710e..1daa83d 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
@@ -510,11 +510,13 @@ func (o *rebuilder) wantFunc(ctx context.Context, treeID btrfsprim.ObjID, objID
//
// interval is [beg, end)
func (o *rebuilder) wantCSum(ctx context.Context, beg, end btrfsvol.LogicalAddr) {
- if !o.rebuilt.AddTree(ctx, btrfsprim.CSUM_TREE_OBJECTID) {
+ treeID := btrfsprim.CSUM_TREE_OBJECTID
+ if !o.rebuilt.AddTree(ctx, treeID) {
o.queue = append(o.queue, o.curKey)
return
}
+ last := beg
for beg < end {
// Figure out which key we want.
@@ -531,20 +533,20 @@ func (o *rebuilder) wantCSum(ctx context.Context, beg, end btrfsvol.LogicalAddr)
})
if rbNode == nil {
- o.wantAugment(ctx, btrfsprim.CSUM_TREE_OBJECTID, nil) // log an error
beg += btrfssum.BlockSize
continue
+ } else if last < beg {
+ dlog.Errorf(ctx, "augment(tree=%v): could not find csum items for %v-%v", treeID, last, beg)
}
run := rbNode.Value.Sums
key := rbNode.Value.Key
- treeID := btrfsprim.CSUM_TREE_OBJECTID
// Check if we already have it.
// .Search is more efficient than .Load, because it doesn't load the body (and we don't need the body).
if _, ok := o.rebuilt.Search(ctx, treeID, key.Cmp); !ok {
// We need to insert it.
- itemPtr, ok := o.rebuilt.Keys(btrfsprim.CSUM_TREE_OBJECTID).Load(key)
+ itemPtr, ok := o.rebuilt.Keys(treeID).Load(key)
if !ok {
// This is a panic because if we found it in `o.csums` then it has
// to be in some Node, and if we didn't find it from
@@ -555,6 +557,10 @@ func (o *rebuilder) wantCSum(ctx context.Context, beg, end btrfsvol.LogicalAddr)
}
beg = run.Addr.Add(run.Size())
+ last = beg
+ }
+ if last < beg {
+ dlog.Errorf(ctx, "augment(tree=%v): could not find csum items for %v-%v", treeID, last, beg)
}
}