diff --git a/src/blockstore_impl.cpp b/src/blockstore_impl.cpp index 76ec6645..5a4e9a9b 100644 --- a/src/blockstore_impl.cpp +++ b/src/blockstore_impl.cpp @@ -193,6 +193,7 @@ void blockstore_impl_t::loop() } if (wr_st == 2) { + submit_queue[op_idx] = NULL; new_idx--; } if (wr_st == 0) diff --git a/src/blockstore_write.cpp b/src/blockstore_write.cpp index 689b5d8d..ad714208 100644 --- a/src/blockstore_write.cpp +++ b/src/blockstore_write.cpp @@ -182,9 +182,15 @@ void blockstore_impl_t::cancel_all_writes(blockstore_op_t *op, blockstore_dirty_ bool found = false; for (auto other_op: submit_queue) { - // may be present in queue multiple times due to moving operations in submit_queue - if (other_op == op) + if (!other_op) + { + // freed operations during submitting are zeroed + } + else if (other_op == op) + { + // may be present in queue multiple times due to moving operations in submit_queue found = true; + } else if (found && other_op->oid == op->oid && (other_op->opcode == BS_OP_WRITE || other_op->opcode == BS_OP_WRITE_STABLE)) {