Handle integer overflow of the op_stat_count

This commit is contained in:
Vitaliy Filippov
2020-05-15 01:37:17 +03:00
parent 2c3e84cc41
commit 19f25c7cd5
5 changed files with 27 additions and 1 deletions
+5
View File
@@ -247,6 +247,11 @@ resume_5:
{
int recovery_type = op_data->object_state->state & (OBJ_DEGRADED|OBJ_INCOMPLETE) ? 0 : 1;
recovery_stat_count[0][recovery_type]++;
if (recovery_stat_count[0][recovery_type])
{
recovery_stat_count[0][recovery_type]++;
recovery_stat_bytes[0][recovery_type] = 0;
}
for (int role = 0; role < pg.pg_size; role++)
{
recovery_stat_bytes[0][recovery_type] += op_data->stripes[role].write_end - op_data->stripes[role].write_start;