Fix possible segfault on ENOSPC

rm-left-on-dead
Vitaliy Filippov 2022-11-12 11:59:43 +03:00
parent 5f26887d32
commit b4edc79449
1 changed files with 2 additions and 1 deletions

View File

@ -182,7 +182,8 @@ void blockstore_impl_t::cancel_all_writes(blockstore_op_t *op, blockstore_dirty_
bool found = false;
for (auto other_op: submit_queue)
{
if (!found && other_op == op)
// <op> may be present in queue multiple times due to moving operations in submit_queue
if (other_op == op)
found = true;
else if (found && other_op->oid == op->oid &&
(other_op->opcode == BS_OP_WRITE || other_op->opcode == BS_OP_WRITE_STABLE))