[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH lvconvert 6/11] init_mirror_in_sync(0) for corelog mirror addition



Since corelog mirror is controlled by the global _mirror_in_sync,
lv_add_mirrors() should explicitly reset it when adding mirrors
with corelog.
Otherwise, it might be set 'in-sync' in some other places and
skip sync process.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
Corelog mirror depends on init_mirror_in_sync() for the decision
whether it should start resync or not.
In case init_mirror_in_sync(1) was called somewhere before lv_add_mirrors(),
we have to explicitly call init_mirror_in_sync(0).

Index: LVM2.work/lib/metadata/mirror.c
===================================================================
--- LVM2.work.orig/lib/metadata/mirror.c
+++ LVM2.work/lib/metadata/mirror.c
@@ -1276,6 +1276,13 @@ int lv_add_mirrors(struct cmd_context *c
 		return 0;
 	}
 
+	/* For corelog mirror, activation code depends on
+	 * the global mirror_in_sync status. As we are adding
+	 * a new mirror, it should be set as 'out-of-sync'
+	 * so that the sync starts. */
+	if (!log_count)
+		init_mirror_in_sync(0);
+
 	if (flags & MIRROR_BY_SEG) {
 		if (log_count) {
 			log_error("Persistent log is not supported on "

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]