diff options
author | NeilBrown <neilb@suse.de> | 2008-09-18 16:03:08 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-09-18 16:03:08 +1000 |
commit | ffcfc735a5114290cb6b3063c8a5fddddc384a36 (patch) | |
tree | 0de2c4885412e4d6d2a7d030679ae5917325100d /Create.c | |
parent | c5afc314e2c36d54bf78b0d0049995c0f2df821c (diff) |
Don't allow spares when creating 'external' arrays.
It is meaningless when creating the container, and for
subarrays, the container is responsible for assigning
spares.
Also, don't do the 'spare' fiddle for raid5 as we cannot
set up a spare at this point yet. Later maybe just create
the array degraded and let the container sort it out.
Diffstat (limited to 'Create.c')
-rw-r--r-- | Create.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -166,6 +166,12 @@ int Create(struct supertype *st, char *mddev, int mdfd, devlist = NULL; } } + if (st && st->ss->external && sparedisks) { + fprintf(stderr, + Name ": This metadata type does not support " + "spare disks are create time\n"); + return 1; + } if (subdevs > raiddisks+sparedisks) { fprintf(stderr, Name ": You have listed more devices (%d) than are in the array(%d)!\n", subdevs, raiddisks+sparedisks); return 1; @@ -411,6 +417,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, * into a spare, else the create will fail */ if (assume_clean == 0 && force == 0 && first_missing < raiddisks && + st->ss->external == 0 && second_missing >= raiddisks && level == 6) { insert_point = raiddisks - 1; if (insert_point == first_missing) |