From 3c8e4c6b7266fad5222ba982dd547ed63081bdfe Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 17 Jun 2023 01:17:16 +0300 Subject: [PATCH] Use clean_dyn_size for space check --- src/blockstore_write.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blockstore_write.cpp b/src/blockstore_write.cpp index 16c9ad4d..8df2ed6a 100644 --- a/src/blockstore_write.cpp +++ b/src/blockstore_write.cpp @@ -311,7 +311,7 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op) { blockstore_journal_check_t space_check(this); if (!space_check.check_available(op, unsynced_big_write_count + 1, - sizeof(journal_entry_big_write) + dsk.clean_entry_bitmap_size, + sizeof(journal_entry_big_write) + dsk.clean_dyn_size, (dirty_it->second.state & BS_ST_INSTANT) ? JOURNAL_INSTANT_RESERVATION : JOURNAL_STABILIZE_RESERVATION)) { return 0; @@ -398,7 +398,7 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op) blockstore_journal_check_t space_check(this); if (unsynced_big_write_count && !space_check.check_available(op, unsynced_big_write_count, - sizeof(journal_entry_big_write) + dsk.dirty_dyn_size(0, dsk.data_block_size), 0) + sizeof(journal_entry_big_write) + dsk.clean_dyn_size, 0) || !space_check.check_available(op, 1, sizeof(journal_entry_small_write) + dyn_size, op->len + ((dirty_it->second.state & BS_ST_INSTANT) ? JOURNAL_INSTANT_RESERVATION : JOURNAL_STABILIZE_RESERVATION)))