diff --git a/state.c b/state.c index 0feb3067..55ef2418 100644 --- a/state.c +++ b/state.c @@ -735,6 +735,12 @@ static void state_map(struct snapraid_state* state) ++hole; } + if (hole > 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); + } + /* insert the new mapping */ map = map_alloc(disk->name, hole, "");