mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 23:16:28 -05:00
Enforces the 21 data disk limit.
This commit is contained in:
parent
f4c1e288b2
commit
81d3b2ad78
3 changed files with 18 additions and 7 deletions
9
raid.h
9
raid.h
|
|
@ -22,9 +22,14 @@
|
|||
/* raid */
|
||||
|
||||
/**
|
||||
* Max number of data disks for quad parity.
|
||||
* Max number of data disks for RAID6.
|
||||
*/
|
||||
#define RAID_QUAD_DATA_LIMIT 21
|
||||
#define RAID6_DATA_LIMIT 21
|
||||
|
||||
/**
|
||||
* Max number of data disks for RAIDQP.
|
||||
*/
|
||||
#define RAIDQP_DATA_LIMIT 21
|
||||
|
||||
/**
|
||||
* Syndrome computation.
|
||||
|
|
|
|||
|
|
@ -168,8 +168,8 @@ static void raidtest(unsigned diskmax, unsigned block_size)
|
|||
unsigned char* c;
|
||||
unsigned char* p;
|
||||
|
||||
/* this is the point where quad parity fails over RAID_QUAD_DATA_LIMIT data disks */
|
||||
if (diskmax > RAID_QUAD_DATA_LIMIT && COMBO3[n].use[2] >= 3)
|
||||
/* this is the point where quad parity fails over RAIDQP_DATA_LIMIT data disks */
|
||||
if (diskmax > RAIDQP_DATA_LIMIT && COMBO3[n].use[2] >= 3)
|
||||
continue;
|
||||
|
||||
/* save */
|
||||
|
|
|
|||
12
state.c
12
state.c
|
|
@ -23,6 +23,7 @@
|
|||
#include "util.h"
|
||||
#include "parity.h"
|
||||
#include "cpu.h"
|
||||
#include "raid.h"
|
||||
|
||||
const char* lev_name(unsigned l)
|
||||
{
|
||||
|
|
@ -176,9 +177,14 @@ static void state_config_check(struct snapraid_state* state, const char* path)
|
|||
++diskcount;
|
||||
}
|
||||
|
||||
if (diskcount > 255) {
|
||||
/* RAID6 P/Q parity works for up to 255 drives, no more */
|
||||
fprintf(stderr, "Too many disks. No more than 255.\n");
|
||||
if (state->level >= 2 && diskcount > RAID6_DATA_LIMIT) {
|
||||
/* RAID6 parity works for up to 255 drives, no more */
|
||||
fprintf(stderr, "Too many disks for RAID6. No more than %u.\n", RAID6_DATA_LIMIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (state->level >= 4 && diskcount > RAIDQP_DATA_LIMIT) {
|
||||
/* RAIDQP parity works for up to 21 drives, no more */
|
||||
fprintf(stderr, "Too many disks for RAIDQP. No more than %u.\n", RAIDQP_DATA_LIMIT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue