Subdevs can't be all missing when create raid device

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
Xiao Ni 2018-01-26 16:42:16 +08:00 committed by Jes Sorensen
parent a3b831c9e1
commit 1db0376585
1 changed files with 4 additions and 0 deletions

View File

@ -475,6 +475,10 @@ int Create(struct supertype *st, char *mddev,
close(fd);
}
}
if (missing_disks == dnum) {
pr_err("Subdevs can't be all missing\n");
return 1;
}
if (s->raiddisks + s->sparedisks > st->max_devs) {
pr_err("Too many devices: %s metadata only supports %d\n",
st->ss->name, st->max_devs);