From: Xiao Ni Date: Fri, 26 Jan 2018 08:42:16 +0000 (+0800) Subject: Subdevs can't be all missing when create raid device X-Git-Tag: mdadm-4.1-rc1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1db0376585e3aa49f004e5b6475a07d5728a63f9;p=thirdparty%2Fmdadm.git Subdevs can't be all missing when create raid device Signed-off-by: Xiao Ni Signed-off-by: Jes Sorensen --- 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);