summaryrefslogtreecommitdiff
path: root/daemons/dmeventd/plugins
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-06-24 00:06:12 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-06-24 00:06:12 +0200
commit0016b79c8b3223de7155fb4ec5fa799f7af1c811 (patch)
treeb006553200f362fef709720c7aabcb0e2c237f9a /daemons/dmeventd/plugins
parent2a50a28f3e8e5a1a7ecbf247f27cc8178ee286bf (diff)
downloadlvm2-0016b79c8b3223de7155fb4ec5fa799f7af1c811.tar.gz
dmeventd: improve more raid status reporting
When we want to report primary leg failure, check for intial 'a', since otherwice 'Aa idle' is normally visible. Also reset array of bit flags marking dead devices, once plugin detects raid is in sync.
Diffstat (limited to 'daemons/dmeventd/plugins')
-rw-r--r--daemons/dmeventd/plugins/raid/dmeventd_raid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/daemons/dmeventd/plugins/raid/dmeventd_raid.c b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
index 666362aa8..52cf43d6b 100644
--- a/daemons/dmeventd/plugins/raid/dmeventd_raid.c
+++ b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
@@ -68,7 +68,8 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
* This is simply the way the kernel works...
*/
if (!strcmp(status->sync_action, "idle") &&
- strchr(status->dev_health, 'a')) {
+ (status->dev_health[0] == 'a') &&
+ (status->insync_regions < status->total_regions)) {
log_error("Primary sources for new RAID, %s, have failed.",
device);
dead = 1; /* run it through LVM repair */
@@ -97,6 +98,8 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
}
} else {
state->failed = 0;
+ if (status->insync_regions == status->total_regions)
+ memset(&state->raid_devs, 0, sizeof(state->raid_devs));
log_info("%s array, %s, is %s in-sync.",
status->raid_type, device,
(status->insync_regions == status->total_regions) ? "now" : "not");