mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 09:26:27 -05:00
Adds an extra check for the too may disks condition.
This commit is contained in:
parent
0c553a3641
commit
a2b41f23be
1 changed files with 9 additions and 0 deletions
9
state.c
9
state.c
|
|
@ -117,6 +117,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, i
|
||||||
|
|
||||||
/* check if all the data and parity disks are different */
|
/* check if all the data and parity disks are different */
|
||||||
if (!skip_device) {
|
if (!skip_device) {
|
||||||
|
unsigned diskcount = 0;
|
||||||
for(i=state->disklist;i!=0;i=i->next) {
|
for(i=state->disklist;i!=0;i=i->next) {
|
||||||
tommy_node* j;
|
tommy_node* j;
|
||||||
struct snapraid_disk* disk = i->data;
|
struct snapraid_disk* disk = i->data;
|
||||||
|
|
@ -138,6 +139,14 @@ static void state_config_check(struct snapraid_state* state, const char* path, i
|
||||||
fprintf(stderr, "Disk '%s' and parity '%s' are on the same device.\n", disk->dir, state->qarity);
|
fprintf(stderr, "Disk '%s' and parity '%s' are on the same device.\n", disk->dir, state->qarity);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++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");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->qarity[0] != 0 && state->parity_device == state->qarity_device) {
|
if (state->qarity[0] != 0 && state->parity_device == state->qarity_device) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue