mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Avoid a float division by zero in testing
In the regression testing the fake probability goes to 0, resulting in an impossible division.
This commit is contained in:
parent
a45641dcc9
commit
9d4fd25774
1 changed files with 4 additions and 0 deletions
|
|
@ -570,6 +570,10 @@ static double raid_prob_of_one_or_more_failures(double array_failure_rate, doubl
|
|||
* Garth Alan Gibson, "Redundant Disk Arrays: Reliable, Parallel Secondary Storage", 1990
|
||||
*/
|
||||
|
||||
/* avoid division by zero */
|
||||
if (array_failure_rate == 0)
|
||||
return 0;
|
||||
|
||||
/* get the Mean Time Between Failure of a single disk */
|
||||
/* from the array failure rate */
|
||||
MTBF = n / array_failure_rate;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue