public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ ...
@ 2012-05-05  2:08 jbrassow
  0 siblings, 0 replies; 5+ messages in thread
From: jbrassow @ 2012-05-05  2:08 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2012-05-05 02:08:47

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	test/shell     : lvconvert-mirror.sh 

Log message:
	Fix up-convert when mirror activation is controled by volume_list and tags.
	
	When mirrors are up-converted, a transient mirror layer is put in so that
	only the new devices are sync'ed.  That transient layer must carry the tags
	of the original mirror LV, otherwise it will fail to activate when activation
	is regulated by lvm.conf:activation/volume_list.  The conversion would then
	fail.
	
	The fix is to do exactly the same thing that is being done for linear ->
	mirror converting (lib/metadata/mirror.c:_init_mirror_log()).  We copy the
	tags temporarily for the new LV and remove them after the activation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2396&r2=1.2397
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.373&r2=1.374
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/lvconvert-mirror.sh.diff?cvsroot=lvm2&r1=1.5&r2=1.6

--- LVM2/WHATS_NEW	2012/05/01 19:21:24	1.2396
+++ LVM2/WHATS_NEW	2012/05/05 02:08:46	1.2397
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Fix up-convert when mirror activation is controled by volume_list and tags.
   Disallow snapshots of mirror segment type.
   Fix bug in cmirror that caused incorrect status info to print on some nodes.
   Remove statement that snapshots cannot be tagged from lvm man page.
--- LVM2/lib/metadata/lv_manip.c	2012/05/01 19:21:24	1.373
+++ LVM2/lib/metadata/lv_manip.c	2012/05/05 02:08:47	1.374
@@ -3682,9 +3682,10 @@
 					   const char *layer_suffix)
 {
 	int r;
-	struct logical_volume *layer_lv;
 	char *name;
 	size_t len;
+	struct str_list *sl;
+	struct logical_volume *layer_lv;
 	struct segment_type *segtype;
 	struct lv_segment *mapseg;
 	unsigned exclusive = 0;
@@ -3722,6 +3723,14 @@
 			return NULL;
 		}
 
+		/* Temporary tags for activation of the transient LV */
+		dm_list_iterate_items(sl, &lv_where->tags)
+			if (!str_list_add(cmd->mem, &layer_lv->tags, sl->str)) {
+				log_error("Aborting.  Unable to tag"
+					  " transient mirror layer.");
+				return NULL;
+			}
+
 		if (!vg_write(lv_where->vg)) {
 			log_error("Failed to write intermediate VG %s metadata for mirror conversion.", lv_where->vg->name);
 			return NULL;
@@ -3744,6 +3753,11 @@
 				  name, lv_where->vg->name);
 			return NULL;
 		}
+
+		/* Remove the temporary tags */
+		dm_list_iterate_items(sl, &lv_where->tags)
+			str_list_del(&layer_lv->tags, sl->str);
+
 	}
 
 	log_very_verbose("Inserting layer %s for %s",
--- LVM2/test/shell/lvconvert-mirror.sh	2012/03/16 13:00:06	1.5
+++ LVM2/test/shell/lvconvert-mirror.sh	2012/05/05 02:08:47	1.6
@@ -15,16 +15,28 @@
 	while test $(get lv_field $1 copy_percent) != "100.00"; do sleep 1; done
 }
 
-# convert from linear to 2-way mirror
 aux prepare_pvs 5 10
 # FIXME - test fails with extent size < 512k
 vgcreate -c n -s 512k $vg $(cat DEVICES)
 
+# convert from linear to 2-way mirror
 lvcreate -l2 -n $lv1 $vg "$dev1"
 lvconvert -i1 -m+1 $vg/$lv1 "$dev2" "$dev3:0-1"
 check mirror $vg $lv1 "$dev3"
 lvremove -ff $vg
 
+# convert from linear to 2-way mirror - with tags and volume_list (bz683270)
+lvcreate -l2 -n $lv1 $vg --addtag hello
+lvconvert -i1 -m+1 $vg/$lv1 \
+    --config 'activation { volume_list = [ "@hello" ] }'
+lvremove -ff $vg
+
+# convert from 2-way to 3-way mirror - with tags and volume_list (bz683270)
+lvcreate -l2 -m1 -n $lv1 $vg --addtag hello
+lvconvert -i1 -m+1 $vg/$lv1 \
+    --config 'activation { volume_list = [ "@hello" ] }'
+lvremove -ff $vg
+
 # convert from 2-way mirror to linear
 lvcreate -l2 -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-1"
 lvconvert -m-1 $vg/$lv1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ ...
@ 2012-05-01 19:21 jbrassow
  0 siblings, 0 replies; 5+ messages in thread
From: jbrassow @ 2012-05-01 19:21 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2012-05-01 19:21:25

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	test/shell     : lvconvert-repair-snapshot.sh 
	                 snapshots-of-mirrors.sh 
	                 vgreduce-removemissing-snapshot.sh 

Log message:
	Disallow snapshots of mirror segment types.
	
	Snapshots of RAID logical volumes are allowed (including "raid1").  However,
	snapshots of "mirror" logical volumes has been disallowed due to unsolvable
	issues inherent to the design.  The fact that mirroring (dm-raid1.c) must
	stop all I/O as the result of a failure and wait for userspace intervention
	can lead to a circular dependency if userspace is simultaneously waiting for
	snapshots (on mirrors) to make an I/O update before proceeding.
	
	Various snapshot on mirror tests have been removed as a result.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2395&r2=1.2396
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.372&r2=1.373
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/lvconvert-repair-snapshot.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/snapshots-of-mirrors.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/shell/vgreduce-removemissing-snapshot.sh.diff?cvsroot=lvm2&r1=1.2&r2=1.3

--- LVM2/WHATS_NEW	2012/04/26 17:30:49	1.2395
+++ LVM2/WHATS_NEW	2012/05/01 19:21:24	1.2396
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Disallow snapshots of mirror segment type.
   Fix bug in cmirror that caused incorrect status info to print on some nodes.
   Remove statement that snapshots cannot be tagged from lvm man page.
   Disallow changing cluster attribute of VG while RAID LVs are active.
--- LVM2/lib/metadata/lv_manip.c	2012/03/05 15:05:25	1.372
+++ LVM2/lib/metadata/lv_manip.c	2012/05/01 19:21:24	1.373
@@ -4208,12 +4208,10 @@
 				return NULL;
 			}
 
-			if ((org->status & MIRROR_IMAGE) ||
-			    (org->status & MIRROR_LOG)) {
-				log_error("Snapshots of mirror %ss "
-					  "are not supported",
-					  (org->status & MIRROR_LOG) ?
-					  "log" : "image");
+			if (lv_is_mirror_type(org) &&
+			    !seg_is_raid(first_seg(org))) {
+				log_error("Snapshots of \"mirror\" segment types"
+					  " are not supported");
 				return NULL;
 			}
 
--- LVM2/test/shell/lvconvert-repair-snapshot.sh	2012/03/16 13:00:06	1.2
+++ LVM2/test/shell/lvconvert-repair-snapshot.sh	2012/05/01 19:21:25	1.3
@@ -11,6 +11,13 @@
 
 . lib/test
 
+exit 0
+#
+# Snapshots of 'mirrors' are not supported.  They can no longer be created.
+# This file could be used to test some aspect of lvconvert, snapshot, and
+# RAID at some point though...
+#
+
 aux prepare_vg 5
 aux lvmconf 'allocation/maximise_cling = 0'
 aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'
--- LVM2/test/shell/snapshots-of-mirrors.sh	2012/03/16 13:00:06	1.2
+++ LVM2/test/shell/snapshots-of-mirrors.sh	2012/05/01 19:21:25	1.3
@@ -13,9 +13,15 @@
 
 aux prepare_vg 4
 
-# Create snapshot of a mirror origin
+# Attempt to create snapshot of a mirror origin - should fail
 lvcreate -m 1 -L 10M -n lv $vg
-lvcreate -s $vg/lv -L 10M -n snap
+not lvcreate -s $vg/lv -L 10M -n snap
+
+exit 0
+
+#
+# Snapshots of mirrors are no longer allowed.
+#
 
 # Down-convert (mirror -> linear) under a snapshot
 lvconvert -m0 $vg/lv
--- LVM2/test/shell/vgreduce-removemissing-snapshot.sh	2012/03/16 13:00:06	1.2
+++ LVM2/test/shell/vgreduce-removemissing-snapshot.sh	2012/05/01 19:21:25	1.3
@@ -11,6 +11,14 @@
 
 . lib/test
 
+exit 0
+
+#
+# Snapshots of 'mirrors' are not supported.  They can no longer be created.
+# This file could be used to test some aspect of vgreduce, snapshot, and
+# RAID at some point though...
+#
+
 aux prepare_vg 5
 
 lvcreate -m 3 --ig -L 2M -n 4way $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5":0


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ ...
@ 2011-11-18 19:25 zkabelac
  0 siblings, 0 replies; 5+ messages in thread
From: zkabelac @ 2011-11-18 19:25 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-18 19:25:21

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	test           : t-lvcreate-usage.sh 

Log message:
	Query before removing inactive snapshots
	
	Removal of an inactive origin removes also all related snapshots.
	
	When we now support 'old' external snapshots with thin volumes,
	removal of pool will not only drop all thin volumes, but as
	a consequence also all snapshots - which might be seen a bit
	unexpected for the user - so add a query to confirm such action.
	
	lvremove -f will skip the prompt.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2188&r2=1.2189
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.337&r2=1.338
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.20&r2=1.21

--- LVM2/WHATS_NEW	2011/11/18 19:22:49	1.2188
+++ LVM2/WHATS_NEW	2011/11/18 19:25:20	1.2189
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Add query before removing snapshots when inactive snapshot origin is removed.
   Allow changing availability state of snapshots.
   Skip non-virtual snapshots for availability change for lvchange with vg name.
   Adjusted mirror region size only for mirrors and raids.
--- LVM2/lib/metadata/lv_manip.c	2011/11/15 17:32:12	1.337
+++ LVM2/lib/metadata/lv_manip.c	2011/11/18 19:25:20	1.338
@@ -3248,7 +3248,17 @@
 	}
 
 	if (lv_is_origin(lv)) {
-		/* remove snapshot LVs first */
+		/* Remove snapshot LVs first */
+		if ((force == PROMPT) &&
+		    /* Active snapshot already needs to confirm each active LV */
+		    !lv_is_active(lv) &&
+		    yes_no_prompt("Removing origin %s will also remove %u "
+				  "snapshots(s). Proceed? [y/n]: ",
+				  lv->name, lv->origin_count) == 'n') {
+			log_error("Logical volume %s not removed.", lv->name);
+			return 0;
+		}
+
 		dm_list_iterate_safe(snh, snht, &lv->snapshot_segs)
 			if (!lv_remove_with_dependencies(cmd, dm_list_struct_base(snh, struct lv_segment,
 										  origin_list)->cow,
--- LVM2/test/t-lvcreate-usage.sh	2011/06/28 09:43:28	1.20
+++ LVM2/test/t-lvcreate-usage.sh	2011/11/18 19:25:21	1.21
@@ -122,7 +122,7 @@
 lvrename $vg/$lv1 $vg/$lv2
 lvcreate -s --virtualoriginsize 64m -L 32m -n $lv1 $vg
 lvchange -a n $vg/$lv1
-lvremove $vg/$lv1
+lvremove -ff $vg/$lv1
 lvremove -ff $vg
 
 # readahead default (auto), none, #, auto


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ ...
@ 2011-06-23 10:53 mbroz
  0 siblings, 0 replies; 5+ messages in thread
From: mbroz @ 2011-06-23 10:53 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2011-06-23 10:53:24

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	test           : t-lvconvert-mirror.sh 

Log message:
	Fail allocation if number of extents not divisible by area count
	
	Allocation should fail early if this condition is not met.
	
	Quick fix for https://bugzilla.redhat.com/show_bug.cgi?id=707779

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2024&r2=1.2025
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.262&r2=1.263
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvconvert-mirror.sh.diff?cvsroot=lvm2&r1=1.10&r2=1.11

--- LVM2/WHATS_NEW	2011/06/22 21:31:21	1.2024
+++ LVM2/WHATS_NEW	2011/06/23 10:53:24	1.2025
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Reject allocation if number of extents is not divisible by area count.
   Fix issue preventing cluster mirror creation.
   Disable udev fallback by default and add activation/udev_fallback to lvm.conf.
   Call vg_mark_partial_lvs() before VG structure is returned from the cache.
--- LVM2/lib/metadata/lv_manip.c	2011/06/13 22:28:05	1.262
+++ LVM2/lib/metadata/lv_manip.c	2011/06/23 10:53:24	1.263
@@ -1716,6 +1716,13 @@
 		return 1;
 	}
 
+        if (ah->area_multiple > 1 &&
+            (ah->new_extents - alloc_state.allocated) % ah->area_count) {
+		log_error("Number of extents requested (%d) needs to be divisible by %d.",
+			  ah->new_extents - alloc_state.allocated, ah->area_count);
+		return 0;
+	}
+
 	alloc_state.log_area_count_still_needed = ah->log_area_count;
 
 	if (ah->alloc == ALLOC_CONTIGUOUS)
--- LVM2/test/t-lvconvert-mirror.sh	2011/06/09 19:38:56	1.10
+++ LVM2/test/t-lvconvert-mirror.sh	2011/06/23 10:53:24	1.11
@@ -248,3 +248,8 @@
 lvreduce -f -l1 $vg/$lv1
 lvextend -f -l10 $vg/$lv1
 lvremove -ff $vg/$lv1
+
+# extents must be divisible
+lvcreate -l15 -n $lv1 $vg
+not lvconvert -m1 --corelog --stripes 2 $vg/$lv1
+lvremove -ff $vg/$lv1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ ...
@ 2009-06-01 15:55 mbroz
  0 siblings, 0 replies; 5+ messages in thread
From: mbroz @ 2009-06-01 15:55 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-06-01 15:55:07

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 
	test           : t-lvcreate-usage.sh 

Log message:
	Fix rename of active snapshot with virtual origin.
	
	Code must suspend/resume virtual origin too when renaming
	snaphsot otherwise in kernel old name remains.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1137&r2=1.1138
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.179&r2=1.180
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-lvcreate-usage.sh.diff?cvsroot=lvm2&r1=1.13&r2=1.14

--- LVM2/WHATS_NEW	2009/06/01 14:43:27	1.1137
+++ LVM2/WHATS_NEW	2009/06/01 15:55:06	1.1138
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  Fix rename of active snapshot with virtual origin.
   Fix convert polling to ignore LV with different UUID.
   Cache underlying device readahead only before activation calls.
   Fix segfault when calculating readahead on missing device in vgreduce.
--- LVM2/lib/metadata/lv_manip.c	2009/06/01 14:23:38	1.179
+++ LVM2/lib/metadata/lv_manip.c	2009/06/01 15:55:07	1.180
@@ -1765,6 +1765,8 @@
 {
 	struct volume_group *vg = lv->vg;
 	struct lv_names lv_names;
+	DM_LIST_INIT(lvs_changed);
+	struct lv_list lvl, lvl2;
 	int r = 0;
 
 	/* rename is not allowed on sub LVs */
@@ -1799,22 +1801,27 @@
 		return 0;
 	}
 
+	lvl.lv = lv;
+	dm_list_add(&lvs_changed, &lvl.list);
+
+	/* rename active virtual origin too */
+	if (lv_is_cow(lv) && lv_is_virtual_origin(lvl2.lv = origin_from_cow(lv)))
+		dm_list_add(&lvs_changed, &lvl2.list);
+
 	log_verbose("Writing out updated volume group");
 	if (!vg_write(vg))
 		return 0;
 
-	if (!suspend_lv(cmd, lv)) {
+
+	if (!suspend_lvs(cmd, &lvs_changed)) {
 		vg_revert(vg);
 		goto_out;
 	}
 
-	if (!vg_commit(vg)) {
-		resume_lv(cmd, lv);
-		goto_out;
-	}
+	if (!(r = vg_commit(vg)))
+		stack;
 
-	resume_lv(cmd, lv);
-	r = 1;
+	resume_lvs(cmd, &lvs_changed);
 out:
 	backup(vg);
 	return r;
--- LVM2/test/t-lvcreate-usage.sh	2009/05/13 21:29:10	1.13
+++ LVM2/test/t-lvcreate-usage.sh	2009/06/01 15:55:07	1.14
@@ -116,3 +116,10 @@
 check_lv_field_ $vg/$lv regionsize "4.00M"
 lvremove -ff $vg
 
+# snapshot with virtual origin works
+lvcreate -s --virtualoriginsize 64M -L 32M -n $lv1 $vg
+lvrename $vg/$lv1 $vg/$lv2
+lvcreate -s --virtualoriginsize 64M -L 32M -n $lv1 $vg
+lvchange -a n $vg/$lv1
+lvremove $vg/$lv1
+lvremove -ff $vg


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-05  2:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-05  2:08 LVM2 ./WHATS_NEW lib/metadata/lv_manip.c test/ jbrassow
  -- strict thread matches above, loose matches on Subject: below --
2012-05-01 19:21 jbrassow
2011-11-18 19:25 zkabelac
2011-06-23 10:53 mbroz
2009-06-01 15:55 mbroz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).