Skip to contentSkip to conversation

LVM2 ./WHATS_NEW lib/metadata/lv_manip.c

PATCH [email protected] 1 participant 1 message Feb 22, 2012

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2012-02-22 17:14:39

Modified files:
. : WHATS_NEW
lib/metadata : lv_manip.c

Log message:

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2297&r2=1.2298
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.362&r2=1.363

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.93 - 
 ====================================
+  Fix 'build_parallel_areas_from_lv' to work properly with RAID 4/5/6
 
 Version 2.02.92 - 20th February 2012
 ====================================
lib/metadata/lv_manip.c +5 -2
@@ -3061,7 +3061,8 @@
 	struct dm_list *parallel_areas;
 	struct seg_pvs *spvs;
 	uint32_t current_le = 0;
-	struct lv_segment * uninitialized_var(seg);
+	uint32_t raid_multiple;
+	struct lv_segment *seg = first_seg(lv);
 
 	if (!(parallel_areas = dm_pool_alloc(cmd->mem, sizeof(*parallel_areas)))) {
 		log_error("parallel_areas allocation failed");
@@ -3100,7 +3101,9 @@
 			return_NULL;
 
 		current_le = spvs->le + spvs->len;
-	} while (current_le < lv->le_count);
+		raid_multiple = (seg->segtype->parity_devs) ?
+			seg->area_count - seg->segtype->parity_devs : 1;
+	} while ((current_le * raid_multiple) < lv->le_count);
 
 	/* FIXME Merge adjacent segments with identical PV lists (avoids need for contiguous allocation attempts between successful allocations) */