Skip to contentSkip to conversation

lvm2: sync error handling on secondary mirror in dmeventd

PATCH New Takahiro Yasui 1 participant 1 message Nov 30, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lvm2: sync error handling on secondary mirror in dmeventd

Set the ME_FAILURE flag if the error is related to sync on the secondary mirror. A sync error on the secondary mirror occurs by a write I/O and the error can be treated as the regular write error on mirror legs.

---
 daemons/dmeventd/plugins/mirror/dmeventd_mirror.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
daemons/dmeventd/plugins/mirror/dmeventd_mirror.c +4 -2
Index: LVM2.02.57-20091125/daemons/dmeventd/plugins/mirror/dmeventd_mirror.c
===================================================================
@@ -68,10 +68,12 @@ static int _process_status_code(const ch
 		syslog(LOG_ERR, "%s device %s flush failed.\n",
 		       dev_type, dev_name);
 		r = ME_FAILURE;
-	} else if (status_code == 'S')
+	} else if (status_code == 'S') {
 		syslog(LOG_ERR, "%s device %s sync failed.\n",
 		       dev_type, dev_name);
-	else if (status_code == 'R')
+		if (!strcmp(dev_type, "Secondary mirror"))
+			r = ME_FAILURE;
+	} else if (status_code == 'R')
 		syslog(LOG_ERR, "%s device %s read failed.\n",
 		       dev_type, dev_name);
 	else if (status_code != 'A') {