mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-04 05:40:14 -05:00
Enforce mode parity limits
This commit is contained in:
parent
fcb78a8e29
commit
ee4e3175c8
3 changed files with 26 additions and 5 deletions
|
|
@ -115,7 +115,10 @@ int raid_check(int nr, int *ir, int nd, int np, size_t size, void **v)
|
|||
|
||||
/* enforce limit on number of failures */
|
||||
BUG_ON(nr >= np); /* >= because we check with extra parity */
|
||||
BUG_ON(np > RAID_PARITY_MAX);
|
||||
if (raid_mode(RAID_MODE_GET) == RAID_MODE_VANDERMONDE_RAID)
|
||||
BUG_ON(np > 3);
|
||||
else
|
||||
BUG_ON(np > RAID_PARITY_MAX);
|
||||
|
||||
/* enforce order in index vector */
|
||||
BUG_ON(nr >= 2 && ir[0] >= ir[1]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue