Sadly we have to refcount dyn_data...

This commit is contained in:
Vitaliy Filippov
2023-07-29 12:17:18 +03:00
parent a8ee391e05
commit 45e07d6294
8 changed files with 89 additions and 38 deletions
+2 -1
View File
@@ -244,7 +244,8 @@ void blockstore_impl_t::free_dirty_dyn_data(dirty_entry & e)
size_t dyn_size = dsk.dirty_dyn_size(e.offset, e.len);
if (dyn_size > sizeof(void*) &&
(!journal.inmemory || e.dyn_data < journal.buffer ||
e.dyn_data >= (uint8_t*)journal.buffer + journal.len))
e.dyn_data >= (uint8_t*)journal.buffer + journal.len) &&
--*((int*)e.dyn_data) == 0) // refcount
{
// dyn_data contains the bitmap and checksums
// free it if it doesn't refer to the in-memory journal