Skip to content

Commit

Permalink
Count in ovf headers.
Browse files Browse the repository at this point in the history
We see no space error in write_to_full ut, might
due to when left space == max_wrt_sz and we take max_wrt_sz,
however two extra blks are needed.

Signed-off-by: Xiaoxi Chen <[email protected]>
  • Loading branch information
xiaoxichen committed Oct 22, 2024
1 parent b182e7f commit 9a06c05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tests/test_meta_blk_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ class VMetaBlkMgrTest : public ::testing::Test {

uint64_t size_written{0};
while (free_size > 0) {
if (free_size >= gp.max_wrt_sz) {
// if it is overflow, 2 extra blocks are needed for ovf blk header and meta blk;
if (free_size - 2 * m_mbm->block_size() >= gp.max_wrt_sz) {
size_written = do_sb_write(do_overflow(), 0);
} else {
size_written = do_sb_write(false, m_mbm->meta_blk_context_sz());
Expand Down

0 comments on commit 9a06c05

Please sign in to comment.