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; }