Make journal trimmer wait until reads are completed when inmemory_journal is false

Without this new writes may in theory overwrite journal data being read at that time
This commit is contained in:
Vitaliy Filippov
2022-11-20 01:49:21 +03:00
parent 09a8864686
commit 238037ae31
3 changed files with 35 additions and 9 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ void blockstore_impl_t::erase_dirty(blockstore_dirty_db_t::iterator dirty_start,
#endif
data_alloc->set(dirty_it->second.location >> dsk.block_order, false);
}
int used = --journal.used_sectors[dirty_it->second.journal_sector];
auto used = --journal.used_sectors[dirty_it->second.journal_sector];
#ifdef BLOCKSTORE_DEBUG
printf(
"remove usage of journal offset %08lx by %lx:%lx v%lu (%d refs)\n", dirty_it->second.journal_sector,