From 0016b79c8b3223de7155fb4ec5fa799f7af1c811 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 24 Jun 2017 00:06:12 +0200 Subject: [PATCH] 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. --- WHATS_NEW_DM | 1 + daemons/dmeventd/plugins/raid/dmeventd_raid.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 3e0e8a5d7..83df7cc0a 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.141 - =============================== + Reset array with dead rimage devices once raid gets in sync. Drop unneeded --config option from raid dmeventd plugin. dm_get_status_raid() handle better some incosistent md statuses. Accept truncated files in calls to dm_stats_update_regions_from_fd(). 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");