Fix segfault with concurrent OP_SYNCs
parent
31f9445030
commit
3dd1b22d55
|
@ -98,10 +98,19 @@ void blockstore_impl_t::loop()
|
||||||
{
|
{
|
||||||
// try to submit ops
|
// try to submit ops
|
||||||
unsigned initial_ring_space = ringloop->space_left();
|
unsigned initial_ring_space = ringloop->space_left();
|
||||||
|
// FIXME: rework this "sync polling"
|
||||||
auto cur_sync = in_progress_syncs.begin();
|
auto cur_sync = in_progress_syncs.begin();
|
||||||
while (cur_sync != in_progress_syncs.end())
|
while (cur_sync != in_progress_syncs.end())
|
||||||
{
|
{
|
||||||
continue_sync(*cur_sync++);
|
if (continue_sync(*cur_sync) != 2)
|
||||||
|
{
|
||||||
|
// List is unmodified
|
||||||
|
cur_sync++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cur_sync = in_progress_syncs.begin();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
auto cur = submit_queue.begin();
|
auto cur = submit_queue.begin();
|
||||||
int has_writes = 0;
|
int has_writes = 0;
|
||||||
|
|
|
@ -175,7 +175,7 @@ int blockstore_impl_t::continue_sync(blockstore_op_t *op)
|
||||||
}
|
}
|
||||||
if (PRIV(op)->op_state == SYNC_DONE)
|
if (PRIV(op)->op_state == SYNC_DONE)
|
||||||
{
|
{
|
||||||
ack_sync(op);
|
return ack_sync(op);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ int blockstore_impl_t::ack_sync(blockstore_op_t *op)
|
||||||
ack_one_sync(next_sync);
|
ack_one_sync(next_sync);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue