summaryrefslogtreecommitdiff
path: root/Monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-10-24 13:09:09 +1100
committerNeilBrown <neilb@suse.de>2012-10-24 13:09:09 +1100
commitf1661bd71bec6a8ae1919dc32a227c6fb37843f2 (patch)
tree61171571be032858c13bd9d48f2c9cb844d9723c /Monitor.c
parent839f27a38057a56b213d3e873925712c1c3f4b34 (diff)
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>
Diffstat (limited to 'Monitor.c')
-rw-r--r--Monitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Monitor.c b/Monitor.c
index 69cd8e06..c4d57c31 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -37,6 +37,7 @@ struct state {
int err;
char *spare_group;
int active, working, failed, spare, raid;
+ int from_config;
int expected_spares;
int devstate[MAX_DISKS];
dev_t devid[MAX_DISKS];
@@ -178,6 +179,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 = xstrdup(mdlist->spare_group);
@@ -475,7 +477,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);