Fix the extended integrity checks in the liberasurecode decode
function. Previously, it was failing if the number of invalid fragments was k or greater, which is incorrect. We should only be able to decode if: (num given fragments - num invalid fragments) >= k This means fail if: (num given fragments - num invalid fragments) < k
This commit is contained in:
parent
cf490de5e0
commit
14b1e5bb64
|
@ -594,7 +594,7 @@ int liberasurecode_decode(int desc,
|
|||
++num_invalid_fragments;
|
||||
}
|
||||
}
|
||||
if (num_invalid_fragments > (k - 1)) {
|
||||
if ((num_fragments - num_invalid_fragments) < k) {
|
||||
ret = -EINSUFFFRAGS;
|
||||
log_error("Not enough valid fragments available for decode!");
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue