Fix checksum padding during flush

This commit is contained in:
Vitaliy Filippov
2025-12-02 01:52:12 +03:00
parent 57d83ecf7c
commit 4a0720a231
3 changed files with 48 additions and 65 deletions
+2 -2
View File
@@ -661,9 +661,9 @@ bool blockstore_heap_t::calc_block_checksums(uint32_t *block_csums, uint8_t *bit
bool isset = false;
while (pos < end)
{
uint32_t prev = pos;
if (bitmap)
{
uint32_t prev = pos;
while (pos < end && pos < block_end)
{
while (pos < end && pos < block_end && !(bitmap[pos/dsk->bitmap_granularity/8] & (1 << ((pos/dsk->bitmap_granularity) % 8))))
@@ -696,7 +696,7 @@ bool blockstore_heap_t::calc_block_checksums(uint32_t *block_csums, uint8_t *bit
{
if (bad_block_cb)
{
bad_block_cb(block_end, *block_csums, block_crc);
bad_block_cb(prev, *block_csums, block_crc);
res = false;
}
else