All of lore.kernel.org
 help / color / mirror / Atom feed
From: agk@sourceware.org <agk@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
Date: 26 Oct 2009 10:02:00 -0000	[thread overview]
Message-ID: <20091026100200.24575.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk at sourceware.org	2009-10-26 10:01:58

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/display    : display.c 
	lib/metadata   : lv_manip.c 
	lib/report     : report.c 
	tools          : lvconvert.c vgsplit.c 

Log message:
	Permit snapshots of mirrors.  (brassow)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1302&r2=1.1303
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.160&r2=1.161
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.105&r2=1.106
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.184&r2=1.185
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95

--- LVM2/WHATS_NEW	2009/10/23 01:24:17	1.1302
+++ LVM2/WHATS_NEW	2009/10/26 10:01:56	1.1303
@@ -1,5 +1,6 @@
 Version 2.02.54 -
 =====================================
+  Permit snapshots of mirrors.
   Cleanup mimagetmp LV if allocation fails for new lvconvert mimage.
   Fix clvmd segfault when refresh_toolcontext fails.
   Remember to clear 'global lock held during cache refresh' state after use.
--- LVM2/lib/activate/dev_manager.c	2009/10/22 13:00:07	1.160
+++ LVM2/lib/activate/dev_manager.c	2009/10/26 10:01:57	1.161
@@ -551,16 +551,17 @@
 {
 	char *name;
 	const char *dlid;
+	const char *suffix = (lv_is_origin(lv)) ? "real" : NULL;
 
 	/*
 	 * Build a name for the top layer.
 	 */
-	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, NULL)))
+	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, suffix)))
 		return_0;
 
 	/* FIXME dm_pool_free ? */
 
-	if (!(dlid = build_dlid(dm, lv->lvid.s, NULL))) {
+	if (!(dlid = build_dlid(dm, lv->lvid.s, suffix))) {
 		log_error("dlid build failed for %s", lv->name);
 		return 0;
 	}
--- LVM2/lib/display/display.c	2009/10/01 00:35:29	1.105
+++ LVM2/lib/display/display.c	2009/10/26 10:01:57	1.106
@@ -480,7 +480,7 @@
 	struct lvinfo info;
 	int inkernel, snap_active = 0;
 	char uuid[64] __attribute((aligned(8)));
-	struct lv_segment *snap_seg = NULL;
+	struct lv_segment *snap_seg = NULL, *mirror_seg = NULL;
 	float snap_percent;	/* fused, fsize; */
 	percent_range_t percent_range;
 
@@ -563,6 +563,13 @@
 			  display_size(cmd, (uint64_t) snap_seg->chunk_size));
 	}
 
+	if (lv->status & MIRRORED) {
+ 		mirror_seg = first_seg(lv);
+		log_print("Mirrored volumes       %" PRIu32, mirror_seg->area_count);
+		if (lv->status & CONVERTING)
+			log_print("LV type        Mirror undergoing conversion");
+	}
+
 	log_print("Segments               %u", dm_list_size(&lv->segments));
 
 /********* FIXME Stripes & stripesize for each segment
--- LVM2/lib/metadata/lv_manip.c	2009/09/28 17:46:16	1.184
+++ LVM2/lib/metadata/lv_manip.c	2009/10/26 10:01:57	1.185
@@ -2936,11 +2936,12 @@
 					  "supported yet");
 				return 0;
 			}
-			if (org->status & MIRROR_IMAGE ||
-			    org->status & MIRROR_LOG ||
-			    org->status & MIRRORED) {
-				log_error("Snapshots and mirrors may not yet "
-					  "be mixed.");
+			if ((org->status & MIRROR_IMAGE) ||
+			    (org->status & MIRROR_LOG)) {
+				log_error("Snapshots of mirror %ss "
+					  "are not supported",
+					  (org->status & MIRROR_LOG) ?
+					  "log" : "image");
 				return 0;
 			}
 
--- LVM2/lib/report/report.c	2009/10/01 01:04:27	1.104
+++ LVM2/lib/report/report.c	2009/10/26 10:01:57	1.105
@@ -311,6 +311,11 @@
 		repstr[0] = 'p';
 	else if (lv->status & CONVERTING)
 		repstr[0] = 'c';
+	else if (lv->status & VIRTUAL)
+		repstr[0] = 'v';
+	/* Origin takes precedence over Mirror */
+	else if (lv_is_origin(lv))
+		repstr[0] = 'o';
 	else if (lv->status & MIRRORED) {
 		if (lv->status & MIRROR_NOTSYNCED)
 			repstr[0] = 'M';
@@ -323,10 +328,6 @@
 			repstr[0] = 'I';
 	else if (lv->status & MIRROR_LOG)
 		repstr[0] = 'l';
-	else if (lv->status & VIRTUAL)
-		repstr[0] = 'v';
-	else if (lv_is_origin(lv))
-		repstr[0] = 'o';
 	else if (lv_is_cow(lv))
 		repstr[0] = 's';
 	else
--- LVM2/tools/lvconvert.c	2009/10/23 01:24:17	1.95
+++ LVM2/tools/lvconvert.c	2009/10/26 10:01:57	1.96
@@ -713,6 +713,20 @@
 				  "LV: use lvchange --resync first.");
 			return 0;
 		}
+
+		/*
+		 * We allow snapshots of mirrors, but for now, we
+		 * do not allow up converting mirrors that are under
+		 * snapshots.  The layering logic is somewhat complex,
+		 * and preliminary test show that the conversion can't
+		 * seem to get the correct %'age of completion.
+		 */
+		if (lv_is_origin(lv)) {
+			log_error("Can't add additional mirror images to "
+				  "mirrors that are under snapshots");
+			return 0;
+		}
+
 		/*
 		 * Log addition/removal should be done before the layer
 		 * insertion to make the end result consistent with
@@ -891,12 +905,6 @@
 		return ECMD_FAILED;
 	}
 
-	if (lv_is_origin(lv)) {
-		log_error("Can't convert logical volume \"%s\" under snapshot",
-			  lv->name);
-		return ECMD_FAILED;
-	}
-
 	if (lv_is_cow(lv)) {
 		log_error("Can't convert snapshot logical volume \"%s\"",
 			  lv->name);
--- LVM2/tools/vgsplit.c	2009/09/14 22:47:50	1.94
+++ LVM2/tools/vgsplit.c	2009/10/26 10:01:57	1.95
@@ -411,14 +411,15 @@
 	if (!(_move_lvs(vg_from, vg_to)))
 		goto_bad;
 
-	/* Move required snapshots across */
-	if (!(_move_snapshots(vg_from, vg_to)))
-		goto_bad;
-
+	/* FIXME Separate the 'move' from the 'validation' to fix dev stacks */
 	/* Move required mirrors across */
 	if (!(_move_mirrors(vg_from, vg_to)))
 		goto_bad;
 
+	/* Move required snapshots across */
+	if (!(_move_snapshots(vg_from, vg_to)))
+		goto_bad;
+
 	/* Split metadata areas and check if both vgs have at least one area */
 	if (!(vg_split_mdas(cmd, vg_from, vg_to)) && vg_from->pv_count) {
 		log_error("Cannot split: Nowhere to store metadata for new Volume Group");



             reply	other threads:[~2009-10-26 10:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-26 10:02 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-05 15:05 LVM2 ./WHATS_NEW lib/activate/dev_manager.c li zkabelac
2012-01-20 22:02 snitzer
2011-10-14 13:23 zkabelac
2011-10-06 14:45 jbrassow
2011-08-18 19:38 jbrassow
2010-10-13 21:26 snitzer
2010-04-23 14:16 prajnoha
2010-02-17 22:59 snitzer
2010-01-15 16:35 snitzer
2009-10-22 13:00 prajnoha
2008-07-15  0:25 agk
2008-04-10 17:09 wysochanski
2008-01-30 13:19 agk
2007-05-15 14:42 mbroz
2006-11-30 23:11 agk
2006-10-18 18:01 agk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091026100200.24575.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.