Fix pending_ops

This commit is contained in:
Vitaliy Filippov
2025-12-02 01:52:12 +03:00
parent 84961f6d0a
commit 0bc81f5320
3 changed files with 7 additions and 7 deletions
+1
View File
@@ -166,6 +166,7 @@ void blockstore_impl_t::loop()
}
if (wr_st == 0)
{
PRIV(op)->pending_ops = 0;
ringloop->restore(prev_sqe_pos);
if (PRIV(op)->wait_for == WAIT_SQE)
{
+5 -5
View File
@@ -6,6 +6,10 @@
int blockstore_impl_t::continue_sync(blockstore_op_t *op)
{
int op_state = PRIV(op)->op_state;
if (op_state == 1) goto resume_1;
if (op_state == 2) goto resume_2;
assert(!op_state);
if (immediate_commit == IMMEDIATE_ALL || !unsynced_big_write_count && !unsynced_small_write_count)
{
// We can return immediately because sync is only dequeued after all previous writes
@@ -14,10 +18,6 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
FINISH_OP(op);
return 2;
}
int op_state = PRIV(op)->op_state;
if (op_state == 1) goto resume_1;
if (op_state == 2) goto resume_2;
assert(!op_state);
stop_sync_submitted = false;
if (unsynced_small_write_count > 0 && !disable_journal_fsync)
{
@@ -28,7 +28,7 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
data->callback = [this, op](ring_data_t *data) { handle_write_event(data, op); };
PRIV(op)->pending_ops++;
}
if (!disable_meta_fsync)
if (!disable_meta_fsync && dsk.meta_fd != dsk.journal_fd)
{
// fsync meta
BS_SUBMIT_GET_SQE(sqe, data);
+1 -2
View File
@@ -87,7 +87,6 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
int res = heap->post_delete(op->oid, &modified_block);
assert(res == 0);
prepare_meta_block_write(op, modified_block);
PRIV(op)->pending_ops++;
PRIV(op)->op_state = 5;
write_iodepth++;
}
@@ -142,7 +141,7 @@ int blockstore_impl_t::dequeue_write(blockstore_op_t *op)
io_uring_prep_writev(
sqe, dsk.data_fd, PRIV(op)->iov_zerofill, vcnt, dsk.data_offset + loc + op->offset - stripe_offset
);
PRIV(op)->pending_ops = 1;
PRIV(op)->pending_ops++;
unsynced_big_write_count++;
PRIV(op)->op_state = 1;
write_iodepth++;