summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2018-01-26 09:42:16 +0100
committerJes Sorensen <jsorensen@fb.com>2018-01-26 19:51:01 +0100
commit1db0376585e3aa49f004e5b6475a07d5728a63f9 (patch)
tree2169b5d596acb5141b8c98246caca25e7b08bcc2
parentGrow.c: Block any level migration with chunk size change (diff)
downloadmdadm-1db0376585e3aa49f004e5b6475a07d5728a63f9.tar.xz
mdadm-1db0376585e3aa49f004e5b6475a07d5728a63f9.zip
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>
-rw-r--r--Create.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Create.c b/Create.c
index 239545f9..50142d81 100644
--- a/Create.c
+++ b/Create.c
@@ -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);