summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-10-22 10:38:40 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-10-22 22:28:37 +0200
commit9c5c9e2355826ad3835f35e494dde9bb8b1e6356 (patch)
tree13b29a0a0e6ee04c90323611bc1dda696faed1ba
parentcde12cbe9e4d3cabefc8644846e86b73b6217b6d (diff)
downloadlvm2-9c5c9e2355826ad3835f35e494dde9bb8b1e6356.tar.gz
dmeventd: raid plugin reporting
Fix raid logging introduced with last updating commit.
-rw-r--r--daemons/dmeventd/plugins/raid/dmeventd_raid.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/daemons/dmeventd/plugins/raid/dmeventd_raid.c b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
index f00ffa4ce..2f200bae2 100644
--- a/daemons/dmeventd/plugins/raid/dmeventd_raid.c
+++ b/daemons/dmeventd/plugins/raid/dmeventd_raid.c
@@ -37,14 +37,17 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
return 0;
}
- if ((d = strchr(status->dev_health, 'D')) && !state->failed) {
+ if ((d = strchr(status->dev_health, 'D'))) {
+ if (state->failed)
+ goto out; /* already reported */
+
log_error("Device #%d of %s array, %s, has failed.",
(int)(d - status->dev_health),
status->raid_type, device);
state->failed = 1;
if (!dmeventd_lvm2_run_with_lock(state->cmd_lvscan))
- log_info("Re-scan of RAID device %s failed.", device);
+ log_warn("WARNING: Re-scan of RAID device %s failed.", device);
/* if repair goes OK, report success even if lvscan has failed */
if (!dmeventd_lvm2_run_with_lock(state->cmd_lvconvert)) {
@@ -58,7 +61,7 @@ static int _process_raid_event(struct dso_state *state, char *params, const char
status->raid_type, device,
(status->insync_regions == status->total_regions) ? "now" : "not");
}
-
+out:
dm_pool_free(state->mem, status);
return 1;