Fix qemu-img broken in 0.5.11

Caused by the lack of reenterability of the main cluster_client function
This commit is contained in:
Vitaliy Filippov
2021-04-08 14:59:20 +03:00
parent 462650134e
commit efb3678606
3 changed files with 26 additions and 1 deletions
+16
View File
@@ -95,6 +95,14 @@ void cluster_client_t::continue_ops(bool up_retry)
// We're offline
return;
}
if (continuing_ops)
{
// Attempt to reenter the function
continuing_ops = 2;
return;
}
restart:
continuing_ops = 1;
bool has_flushes = false, has_writes = false;
int j = 0;
for (int i = 0; i < op_queue.size(); i++)
@@ -141,6 +149,14 @@ void cluster_client_t::continue_ops(bool up_retry)
}
}
op_queue.resize(j);
if (continuing_ops == 2)
{
goto restart;
}
else
{
continuing_ops = 0;
}
}
static uint32_t is_power_of_two(uint64_t value)