check: filter packs while holding blobRefs lock

Not an actual problem with the current usage. But for consistency always
take the lock when interacting with blobRefs.
This commit is contained in:
Michael Eischer
2026-05-16 13:15:31 +02:00
parent d4397926cc
commit 5105015f5d
+3
View File
@@ -302,6 +302,9 @@ func (c *Checker) ReadPacks(ctx context.Context, filter func(packs map[restic.ID
packfileFilter := func(allPacks map[restic.ID]int64) map[restic.ID]int64 {
filteredPacks := make(map[restic.ID]int64)
c.blobRefs.Lock()
defer c.blobRefs.Unlock()
// convert used blobs into their encompassing packfiles
for bh := range c.blobRefs.M.Keys() {
for _, pb := range c.repo.LookupBlob(bh.Type, bh.ID) {