diff options
| -rw-r--r-- | zenstore/compactcas.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index 0f9349ab0..070ca1503 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -230,6 +230,16 @@ CasContainerStrategy::Scrub(ScrubContext& Ctx) for (const CasDiskIndexEntry& Entry : BigChunks) { + IoHashStream Hasher; + m_SmallObjectFile.StreamByteRange(Entry.Location.Offset, Entry.Location.Size, [&](const void* Data, uint64_t Size) { + Hasher.Append(Data, Size); + }); + IoHash ComputedHash = Hasher.GetHash(); + + if (Entry.Key != ComputedHash) + { + BadChunks.push_back(Entry); + } } // Deal with bad chunks by removing them from our lookup map |