All of lore.kernel.org
 help / color / mirror / Atom feed
* Allow mirror log conversion while inactive
@ 2008-06-23 16:05 Jonathan Brassow
  0 siblings, 0 replies; only message in thread
From: Jonathan Brassow @ 2008-06-23 16:05 UTC (permalink / raw)
  To: lvm-devel

 brassow

Allow mirror log conversion (disk -> core) while mirror is inactive.

Addresses bug 192865.


Index: LVM2/lib/metadata/mirror.c
===================================================================
--- LVM2.orig/lib/metadata/mirror.c
+++ LVM2/lib/metadata/mirror.c
@@ -1140,6 +1140,7 @@ int remove_mirror_log(struct cmd_context
 		      struct list *removable_pvs)
 {
 	float sync_percent;
+	struct lvinfo info;
 
 	/* Unimplemented features */
 	if (list_size(&lv->segments) != 1) {
@@ -1148,10 +1149,17 @@ int remove_mirror_log(struct cmd_context
 	}
 
 	/* Had disk log, switch to core. */
-	if (!lv_mirror_percent(cmd, lv, 0, &sync_percent, NULL)) {
-		log_error("Unable to determine mirror sync status.");
+	if (lv_info(cmd, lv, &info, 0, 0) && info.exists) {
+		if (!lv_mirror_percent(cmd, lv, 0, &sync_percent, NULL)) {
+			log_error("Unable to determine mirror sync status.");
+			return 0;
+		}
+	} else if (yes_no_prompt("Converting to core log while inactive will"
+			       " require a complete resync of the mirror.\n"
+			       "Proceed? [y/n]: "))
+		sync_percent = 0;
+	else
 		return 0;
-	}
 
 	if (sync_percent >= 100.0)
 		init_mirror_in_sync(1);




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-23 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-23 16:05 Allow mirror log conversion while inactive Jonathan Brassow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.