Skip to contentSkip to conversation

LVM2 lib/metadata/lv_manip.c test/t-mirror-lvc ...

PATCH [email protected] 1 participant 1 message Jan 11, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2010-01-11 21:20:19

Modified files:

	lib/metadata   : lv_manip.c 
	test           : t-mirror-lvconvert.sh 
	tools          : lvconvert.c 

Log message:
Testsuite updates and fixes for recently added features.

1. Found bug in 'redundant log' implementation that caused problems when converting a linear that spanned multiple devices to a mirror (wasn't checking for NULL value of provided parameter in _alloc_parallel_area)

2. Testsuite was failing to perform tests when 'not' modifier was used. This allowed a couple issues to slip through. Added a 'not_sh' modifier that negates tests performed by functions defined in the shell source file.

3. Was initializing a variable to far down, which cause previously set value to be overridden. (This was the result of the collision of the "redundant log" and lvconvert fix patches.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.194&r2=1.195
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-mirror-lvconvert.sh.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.107&r2=1.108

lib/metadata/lv_manip.c +1 -1
@@ -762,7 +762,7 @@
 		consume_pv_area(areas[s], area_len);
 
 	for (i = 0, s = ah->area_count;
-	     (s < ah->area_count + ah->log_count);
+	     log_areas && (s < ah->area_count + ah->log_count);
 	     s++, i++) {
 		aa[s].pv = log_areas[i]->map->pv;
 		aa[s].pe = log_areas[i]->start;
test/t-mirror-lvconvert.sh +39 -6

85 lines not on this page · raw message

tools/lvconvert.c +1 -6
@@ -613,7 +613,7 @@
 	struct lv_segment *seg;
 	uint32_t existing_mirrors;
 	const char *mirrorlog;
-	unsigned log_count = 0;
+	unsigned log_count = 1;
 	int r = 0;
 	struct logical_volume *log_lv, *layer_lv;
 	int failed_mirrors = 0, failed_log = 0;
@@ -710,11 +710,6 @@
 		/*
 		 * Adjust log type
 		 */
-		/*
-		 * This param used to be 'corelog' and was initialized to '0'.
-		 * We initially set to '1' here so as not to screw the logic.
-		 */
-		log_count = 1;
 		if (arg_count(cmd, corelog_ARG))
 			log_count = 0;