diff options
author | NeilBrown <neilb@suse.de> | 2012-10-24 13:09:09 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-10-24 13:09:23 +1100 |
commit | eb48676077b7108cde236dbcc16f9a02ea143bbb (patch) | |
tree | 7b488bef21f5d6bbe3fb13ea51cdb99d3fdec500 | |
parent | a5d47a2bb5f765eb50383d50c2f28a6a870edcdc (diff) | |
download | mdadm-eb48676077b7108cde236dbcc16f9a02ea143bbb.tar.gz |
Monitor: don't complain about non-monitorable arrays in mdadm.conf
If we are asked to monitor a RAID0 or Linear - which cannot be
monitored - we complain with "Device Disappeared .... Wrong-Level".
However if the RAID0 or Linear is being requested because it is
in mdadm.conf then the message is inappropriate and confusing.
So track which arrays are added from the config file, and suppress
that message in that case.
Reported-by: "Johnson Yan" <johnson_yan@usish.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | Monitor.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -42,6 +42,7 @@ struct state { int err; char *spare_group; int active, working, failed, spare, raid; + int from_config; int expected_spares; int devstate[MaxDisks]; dev_t devid[MaxDisks]; @@ -184,6 +185,7 @@ int Monitor(struct mddev_dev *devlist, st->next = statelist; st->devnum = INT_MAX; st->percent = RESYNC_UNKNOWN; + st->from_config = 1; st->expected_spares = mdlist->spare_disks; if (mdlist->spare_group) st->spare_group = strdup(mdlist->spare_group); @@ -483,7 +485,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, * have a device disappear than all of them that can */ if (array.level == 0 || array.level == -1) { - if (!st->err) + if (!st->err && !st->from_config) alert("DeviceDisappeared", dev, "Wrong-Level", ainfo); st->err = 1; close(fd); |