summaryrefslogtreecommitdiffstats
path: root/Monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-06-04 04:52:36 +0200
committerNeilBrown <neilb@suse.de>2012-06-04 04:52:36 +0200
commit0f760384ebc92d81a988c1501e4a493ef064ad66 (patch)
tree86010a334f6a66713a03f8b8019cfb3ede41b199 /Monitor.c
parentMonitor: fix inconsistencies in values for ->percent (diff)
downloadmdadm-0f760384ebc92d81a988c1501e4a493ef064ad66.tar.xz
mdadm-0f760384ebc92d81a988c1501e4a493ef064ad66.zip
Monitor: Report NewArray when an array the disappeared, reappears.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r--Monitor.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Monitor.c b/Monitor.c
index d9295b52..b8e028ba 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -513,6 +513,13 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
* just make sure it is always different. */
array.utime = st->utime + 1;;
+ if (st->err) {
+ /* New array appeared where previously had and error */
+ st->err = 0;
+ st->percent = RESYNC_NONE;
+ alert("NewArray", st->devname, NULL, ainfo);
+ }
+
if (st->utime == array.utime &&
st->failed == array.failed_disks &&
st->working == array.working_disks &&
@@ -521,7 +528,6 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
mse->percent == st->percent
))) {
close(fd);
- st->err = 0;
if ((st->active < st->raid) && st->spare == 0)
return 1;
else
@@ -714,7 +720,6 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
*statelist = st;
if (test)
alert("TestMessage", st->devname, NULL, info);
- alert("NewArray", st->devname, NULL, info);
new_found = 1;
}
return new_found;