diff mbox

[7,of,10] LVM: monitor mirrored logs

Message ID 201002262336.o1QNaooR024496@hydrogen.msp.redhat.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jonthan Brassow Feb. 26, 2010, 11:36 p.m. UTC
None
diff mbox

Patch

Index: LVM2/lib/activate/activate.c
===================================================================
--- LVM2.orig/lib/activate/activate.c
+++ LVM2/lib/activate/activate.c
@@ -737,6 +737,7 @@  int monitor_dev_for_events(struct cmd_co
 	int r = 1;
 	struct dm_list *tmp, *snh, *snht;
 	struct lv_segment *seg;
+	struct lv_segment *log_seg;
 	int (*monitor_fn) (struct lv_segment *s, int e);
 	uint32_t s;
 
@@ -772,6 +773,16 @@  int monitor_dev_for_events(struct cmd_co
 		return r;
 	}
 
+	/*
+	 * If the volume is mirrored and its log is also mirrored, monitor
+	 * the log volume as well.
+	 */
+	if ((seg = first_seg(lv)) != NULL && seg->log_lv != NULL &&
+	    (log_seg = first_seg(seg->log_lv)) != NULL &&
+	    seg_is_mirrored(log_seg))
+		if (!monitor_dev_for_events(cmd, seg->log_lv, monitor))
+			r = 0;
+
 	dm_list_iterate(tmp, &lv->segments) {
 		seg = dm_list_item(tmp, struct lv_segment);