mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Do not even attempt to recover if there are more failures than parities
This commit is contained in:
parent
e09e55a01b
commit
9f57d3217d
1 changed files with 7 additions and 0 deletions
|
|
@ -173,6 +173,13 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
n = state->level;
|
||||
error = 0;
|
||||
|
||||
/* if failures exceed parity level, recovery is impossible */
|
||||
if (failed_count > n) {
|
||||
log_tag("recover_strategy_error:%u: Impossible to recover from %u failures with %u parity\n",
|
||||
pos, failed_count, n);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* setup vector of failed disk indexes */
|
||||
for (i = 0; i < failed_count; ++i)
|
||||
id[i] = failed[failed_map[i]].index;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue