]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Subdevs can't be all missing when create raid device
authorXiao Ni <xni@redhat.com>
Fri, 26 Jan 2018 08:42:16 +0000 (16:42 +0800)
committerJes Sorensen <jsorensen@fb.com>
Fri, 26 Jan 2018 18:51:01 +0000 (13:51 -0500)
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Create.c

index 239545f9fcfe2b22ae9be9be5e569653407ce601..50142d815901f1798333ebf8a43216c3e2bf01f1 100644 (file)
--- 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);