summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-14 19:44:38 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-14 19:44:38 -0600
commit5adefc3b3eef3d15bc57139ccdba7db68cec4c9f (patch)
treedcb5ac8b1ee9103fee372ba37e2989c264c1a193
parentabff94282174a8f14aec482d2e4992de5915c837 (diff)
parent84f4db04edaf98234019aa973f9b499c47aab5f8 (diff)
Merge branch 'lukeshu/minor'
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go2
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go11
-rwxr-xr-xscripts/main.sh12
3 files changed, 14 insertions, 11 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go
index 04df2b6..56da32d 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go
@@ -130,7 +130,7 @@ func (o *Handle) readNode(ctx context.Context, laddr btrfsvol.LogicalAddr) *disk
panic(fmt.Errorf("should not happen: node@%v is not mentioned in the in-memory graph", laddr))
}
- dlog.Infof(ctx, "cache-miss node@%v, reading...", laddr)
+ dlog.Debugf(ctx, "cache-miss node@%v, reading...", laddr)
ref, err := btrfstree.ReadNode(o.rawFile, o.sb, laddr, btrfstree.NodeExpectations{
LAddr: containers.Optional[btrfsvol.LogicalAddr]{OK: true, Val: laddr},
Level: containers.Optional[uint8]{OK: true, Val: graphInfo.Level},
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
index bc36485..cf334a0 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go
@@ -499,10 +499,13 @@ func (o *rebuilder) resolveTreeAugments(ctx context.Context, treeID btrfsprim.Ob
list = containers.NewSet[btrfsvol.LogicalAddr](o.augmentQueue[treeID].single[wantKey])
}
chose := list.Intersection(ret)
- if len(chose) == 0 {
+ switch {
+ case len(chose) == 0:
dlog.Infof(ctx, "lists[%q]: chose (none) from %v", wantKey, maps.SortedKeys(list))
- } else {
+ case len(list) > 1:
dlog.Infof(ctx, "lists[%q]: chose %v from %v", wantKey, chose.TakeOne(), maps.SortedKeys(list))
+ default:
+ dlog.Debugf(ctx, "lists[%q]: chose %v from %v", wantKey, chose.TakeOne(), maps.SortedKeys(list))
}
}
@@ -571,10 +574,10 @@ func (o *rebuilder) wantAugment(ctx context.Context, wantKey WantWithTree, choic
}
o.augmentQueue[wantKey.TreeID].store(wantKey.Key, choices)
if len(choices) == 0 {
- dlog.Error(ctx, "could not find wanted item")
o.numAugmentFailures++
+ dlog.Debug(ctx, "ERR: could not find wanted item")
} else {
- dlog.Infof(ctx, "choices=%v", maps.SortedKeys(choices))
o.numAugments++
+ dlog.Debugf(ctx, "choices=%v", maps.SortedKeys(choices))
}
}
diff --git a/scripts/main.sh b/scripts/main.sh
index 365862f..4aa96ea 100755
--- a/scripts/main.sh
+++ b/scripts/main.sh
@@ -64,9 +64,9 @@ run-btrfs-rec $gendir/3.nodes.json \
--mappings=$gendir/2.mappings.json \
inspect rebuild-nodes $gendir/0.scandevices.json
-# run-btrfs-rec $gendir/4.ls-files.txt \
-# --mappings=$gendir/2.mappings.json \
-# inspect ls-files
-# run-btrfs-rec $gendir/4.ls-trees.txt \
-# --mappings=$gendir/2.mappings.json \
-# inspect ls-trees --scandevices=$gendir/0.scandevices.json
+run-btrfs-rec $gendir/4.ls-files.txt \
+ --mappings=$gendir/2.mappings.json \
+ inspect ls-files
+run-btrfs-rec $gendir/4.ls-trees.txt \
+ --mappings=$gendir/2.mappings.json \
+ inspect ls-trees --scandevices=$gendir/0.scandevices.json