From 0c5e6d4346b3d412b2d66a9a87fa6d6796432c18 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 11 May 2026 13:03:52 +0300 Subject: [PATCH] Do not use modified_block(ui32) to store lsn(ui64) --- src/blockstore/blockstore_stable.cpp | 1 + src/blockstore/blockstore_sync.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/blockstore/blockstore_stable.cpp b/src/blockstore/blockstore_stable.cpp index 26e001ff..b40775bb 100644 --- a/src/blockstore/blockstore_stable.cpp +++ b/src/blockstore/blockstore_stable.cpp @@ -16,6 +16,7 @@ int blockstore_impl_t::dequeue_stable(blockstore_op_t *op) else if (priv->op_state == 5) goto resume_5; assert(!priv->op_state); op->retval = 0; + PRIV(op)->lsn = 0; priv->modified_block = priv->modified_block2 = UINT32_MAX; for (priv->stab_pos = 0; priv->stab_pos < op->len; priv->stab_pos++) { diff --git a/src/blockstore/blockstore_sync.cpp b/src/blockstore/blockstore_sync.cpp index da94b197..4ec74a8f 100644 --- a/src/blockstore/blockstore_sync.cpp +++ b/src/blockstore/blockstore_sync.cpp @@ -9,6 +9,7 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op) if (!PRIV(op)->op_state) { op->retval = 0; + PRIV(op)->lsn = 0; } int res = do_sync(op, 0); if (res == 2) @@ -104,7 +105,8 @@ int blockstore_impl_t::do_sync(blockstore_op_t *op, int base_state) unsynced_data_write_count = unsynced_buffer_write_count = unsynced_meta_write_count = 0; return 2; } - PRIV(op)->modified_block = heap->get_completed_lsn(); + assert(!PRIV(op)->lsn); + PRIV(op)->lsn = heap->get_completed_lsn(); if (!submit_fsyncs(PRIV(op)->pending_ops)) { PRIV(op)->wait_detail = 1; @@ -118,6 +120,6 @@ resume_1: return 1; } resume_2: - heap->mark_lsn_fsynced(PRIV(op)->modified_block); + heap->mark_lsn_fsynced(PRIV(op)->lsn); return 2; }