From e261af52eb26c22aebd62cdbd8bb79c195274ee9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 9 Oct 2015 21:41:50 +0200 Subject: [PATCH] dmeventd: handle snapshot overflow When snapshot reports overflow, handle it in the same way as Invalid. Until better ideas are implemented. --- WHATS_NEW_DM | 1 + daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index ff4ac2286..efe8b371a 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.110 - ====================================== + Dmeventd handles snapshot overflow for now equally as invalid. Convert dmeventd to use common logging macro system from libdm. Return -ENOMEM when device registration fails instead of 0 (=success). Enforce writethrough mode for cleaner policy. diff --git a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c index ffe6666fe..ae8e308db 100644 --- a/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c +++ b/daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c @@ -150,7 +150,7 @@ void process_event(struct dm_task *dmt, if (!dm_get_status_snapshot(state->mem, params, &status)) goto out; - if (status->invalid) { + if (status->invalid || status->overflow) { struct dm_info info; log_error("Snapshot %s is lost.", device); if (dm_task_get_info(dmt, &info)) { @@ -170,7 +170,7 @@ void process_event(struct dm_task *dmt, * If the snapshot has been invalidated or we failed to parse * the status string. Report the full status string to syslog. */ - if (status->invalid || !status->total_sectors) { + if (status->invalid || status->overflow || !status->total_sectors) { log_error("Snapshot %s changed state to: %s.", device, params); state->percent_check = 0; goto out;