Status: ok Read spares info from config file for --monitor even when devices listed on command line. Signed-off-by: Neil Brown ### Diffstat output ./ChangeLog | 2 ++ ./Monitor.c | 6 ++++++ ./config.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff ./ChangeLog~current~ ./ChangeLog --- ./ChangeLog~current~ 2004-08-27 11:53:39.000000000 +1000 +++ ./ChangeLog 2004-08-27 11:53:38.000000000 +1000 @@ -11,6 +11,8 @@ Changes Prior to this release array is assembled. - Add support for "raid10", which is under development in 2.6. Not documented yet. + - --monitor now reads spare-group and spares info from config file + even when names of arrays to scan are given on the command line Changes Prior to 1.6.0 release - Device name given in -Eb is determined by examining /dev rather diff ./Monitor.c~current~ ./Monitor.c --- ./Monitor.c~current~ 2004-08-27 11:53:39.000000000 +1000 +++ ./Monitor.c 2004-08-27 11:53:38.000000000 +1000 @@ -163,6 +163,7 @@ int Monitor(mddev_dev_t devlist, } else { mddev_dev_t dv; for (dv=devlist ; dv; dv=dv->next) { + mddev_ident_t mdlist = conf_get_ident(config, dv->devname); struct state *st = malloc(sizeof *st); if (st == NULL) continue; @@ -174,6 +175,11 @@ int Monitor(mddev_dev_t devlist, st->percent = -2; st->expected_spares = -1; st->spare_group = NULL; + if (mdlist) { + st->expected_spares = mdlist->spare_disks; + if (mdlist->spare_group) + st->spare_group = strdup(mdlist->spare_group); + } statelist = st; } } diff ./config.c~current~ ./config.c --- ./config.c~current~ 2004-08-27 11:53:39.000000000 +1000 +++ ./config.c 2004-08-27 11:53:38.000000000 +1000 @@ -364,7 +364,7 @@ void arrayline(char *line) } if (mis.devname == NULL) fprintf(stderr, Name ": ARRAY line with no device\n"); - else if (mis.uuid_set == 0 && mis.devices == NULL && mis.super_minor < 0) + else if (mis.uuid_set == 0 && mis.devices == NULL && mis.super_minor == UnSet) fprintf(stderr, Name ": ARRAY line %s has no identity information.\n", mis.devname); else { mi = malloc(sizeof(*mi));