diff options
author | NeilBrown <neilb@suse.de> | 2010-12-01 14:51:27 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-01 14:51:27 +1100 |
commit | acab7bb189f7f1e2ce1b8bbbc00e20358ce3149c (patch) | |
tree | b03769a8f862818b46582ebcc32064c9d53118aa /mdadm.c | |
parent | c82afc17a8fb132a4d0c843554a3b6135ac183b6 (diff) |
Create/grow: improve checks on number of devices.
Check on upper limit of number of devices was in the wrong place.
Result was could not create array with more than 27 devices without
explicitly setting metadata, even though default metadata allows more.
Fixed, and also perform check when growing an array.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 14 |
1 files changed, 0 insertions, 14 deletions
@@ -46,7 +46,6 @@ int main(int argc, char *argv[]) int layout = UnSet; char *layout_str = NULL; int raiddisks = 0; - int max_disks = MD_SB_DISKS; /* just a default */ int sparedisks = 0; struct mddev_ident ident; char *configfile = NULL; @@ -384,7 +383,6 @@ int main(int argc, char *argv[]) fprintf(stderr, Name ": unrecognised metadata identifier: %s\n", optarg); exit(2); } - max_disks = ss->max_devs; continue; case O(MANAGE,'W'): @@ -1122,11 +1120,6 @@ int main(int argc, char *argv[]) } if (raiddisks) { - if (raiddisks > max_disks) { - fprintf(stderr, Name ": invalid number of raid devices: %d\n", - raiddisks); - exit(2); - } if (raiddisks == 1 && !force && level != -5) { fprintf(stderr, Name ": '1' is an unusual number of drives for an array, so it is probably\n" " a mistake. If you really mean it you will need to specify --force before\n" @@ -1134,13 +1127,6 @@ int main(int argc, char *argv[]) exit(2); } } - if (sparedisks) { - if ( sparedisks > max_disks - raiddisks) { - fprintf(stderr, Name ": invalid number of spare-devices: %d\n", - sparedisks); - exit(2); - } - } if (homehost == NULL) homehost = conf_get_homehost(&require_homehost); |