Allows again to use a single data disk with single parity.

This commit is contained in:
Andrea Mazzoleni 2013-12-22 10:31:14 +01:00
parent e4938013a3
commit 7e89583088
2 changed files with 2 additions and 1 deletions

1
raid.h
View file

@ -59,6 +59,7 @@
/**
* Minimum number of data disks.
* Some optimizations require at least two disks.
* It's anyway allowed to have a single data disk with a sigle parity.
*/
#define RAID_DATA_MIN 2

View file

@ -895,7 +895,7 @@ static void state_map(struct snapraid_state* state)
exit(EXIT_FAILURE);
}
/* some raid functions assume at least two data disk */
if (diskcount < RAID_DATA_MIN) {
if (state->level > 1 && diskcount < RAID_DATA_MIN) {
fprintf(stderr, "Too few data disks. You must define at least %u.\n", RAID_DATA_MIN);
exit(EXIT_FAILURE);
}