From 0d9229ff268951d890c57a9a212afeb7fa89e732 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Aug 2022 00:51:34 -0600 Subject: logging --- lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go') diff --git a/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go b/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go index 4ee8207..6a8333a 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go @@ -24,12 +24,13 @@ func matchBlockGroupSums(ctx context.Context, logicalSums btrfssum.SumRunWithGaps[btrfsvol.LogicalAddr], ) error { regions := ListUnmappedPhysicalRegions(fs) + numBlockgroups := len(blockgroups) for i, bgLAddr := range maps.SortedKeys(blockgroups) { blockgroup := blockgroups[bgLAddr] bgRun := SumsForLogicalRegion(logicalSums, blockgroup.LAddr, blockgroup.Size) if len(bgRun.Runs) == 0 { dlog.Errorf(ctx, "... (%v/%v) blockgroup[laddr=%v] can't be matched because it has 0 runs", - i+1, len(blockgroups), bgLAddr) + i+1, numBlockgroups, bgLAddr) continue } @@ -55,7 +56,7 @@ func matchBlockGroupSums(ctx context.Context, lvl = dlog.LogLevelInfo } dlog.Logf(ctx, lvl, "... (%v/%v) blockgroup[laddr=%v] has %v matches based on %v%% coverage from %v runs", - i+1, len(blockgroups), bgLAddr, len(matches), int(100*bgRun.PctFull()), len(bgRun.Runs)) + i+1, numBlockgroups, bgLAddr, len(matches), int(100*bgRun.PctFull()), len(bgRun.Runs)) if len(matches) != 1 { continue } -- cgit v1.2.3-2-g168b