Skip to contentSkip to conversation

master - dmeventd: handle snapshot overflow

PATCH Zdenek Kabelac 1 participant 1 message Oct 13, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e261af52eb26c22aebd62cdbd8bb79c195274ee9
Commit:        e261af52eb26c22aebd62cdbd8bb79c195274ee9
Parent:        3f03d46fc13be2274b3c29d4fc97a3306bc33eda
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Oct 9 21:41:50 2015 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Oct 13 15:15:44 2015 +0200

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 +
 .../dmeventd/plugins/snapshot/dmeventd_snapshot.c  |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
WHATS_NEW_DM +1 -0
index ff4ac22..efe8b37 100644
@@ -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.
daemons/dmeventd/plugins/snapshot/dmeventd_snapshot.c +2 -2
index ffe6666..ae8e308 100644
@@ -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;