[PATCH mdadm] Subdevs can't be all missing when create raid device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 Create.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Create.c b/Create.c
index 239545f..50142d8 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);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux