mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Count disks skipping the holes in the parity number warning
This commit is contained in:
parent
ad57aafd8f
commit
ce20be0ded
1 changed files with 5 additions and 0 deletions
|
|
@ -1142,6 +1142,8 @@ static void state_map(struct snapraid_state* state)
|
|||
if (map->position + 1 > diskcount)
|
||||
diskcount = map->position + 1;
|
||||
}
|
||||
|
||||
/* ensure to don't go over the limit of the RAID engine */
|
||||
if (diskcount > RAID_DATA_MAX) {
|
||||
/* LCOV_EXCL_START */
|
||||
fprintf(stderr, "Too many data disks. No more than %u.\n", RAID_DATA_MAX);
|
||||
|
|
@ -1149,6 +1151,9 @@ static void state_map(struct snapraid_state* state)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* now count the real number of data disks, excluding holes left after removing some */
|
||||
diskcount = tommy_list_count(&state->maplist);
|
||||
|
||||
/* recommend number of parities */
|
||||
if (diskcount >= 36 && state->level < 6) {
|
||||
fprintf(stderr, "WARNING! With %u disks it's recommended to use six parity levels.\n", diskcount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue