master - RAID: Fix broken allocation policies for parity RAID types
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5ded7314ae00629da8d21d925c3fa091cce2a939 Commit: 5ded7314ae00629da8d21d925c3fa091cce2a939 Parent: 6553f86818404cd34fa3600dc976ed25fcf6d65a Author: Jonathan Brassow <[email protected]> AuthorDate: Tue Sep 24 21:32:10 2013 -0500 Committer: Jonathan Brassow <[email protected]> CommitterDate: Tue Sep 24 21:32:10 2013 -0500
RAID: Fix broken allocation policies for parity RAID types
A previous commit (b6bfddcd0a830d0c9312bc3ab906cb3d1b7a6dd9) which was designed to prevent segfaults during lvextend when trying to extend striped logical volumes forgot to include calculations for RAID4/5/6 parity devices. This was causing the 'contiguous' and 'cling_by_tags' allocation policies to fail for RAID 4/5/6.
The solution is to remember that while we can compare
ah->area_count == prev_lvseg->area_count for non-RAID, we should compare (ah->area_count + ah->parity_count) == prev_lvseg->area_count for a general solution. --- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.103 - ====================================== + Fix contiguous & cling allocation policies for parity RAID. (2.02.100) Set use_lvmetad=0 on lvmconf --enable-cluster, reset to default on --disable-cluster. Don't install separate command symlink in binary directory for 'lvm devtypes'. Add seg_size_pe field to reports.
lib/metadata/lv_manip.c +2 -1
@@ -1200,7 +1200,8 @@ static void _init_alloc_parms(struct alloc_handle *ah, struct alloc_parms *alloc alloc_parms->extents_still_needed = extents_still_needed;/* Only attempt contiguous/cling allocation to previous segment areas if the number of areas matches. */ -if (alloc_parms->prev_lvseg && (ah->area_count == prev_lvseg->area_count)) +if (alloc_parms->prev_lvseg && + ((ah->area_count + ah->parity_count) == prev_lvseg->area_count)) alloc_parms->flags |=A_AREA_COUNT_MATCHES ;/* Are there any preceding segments we must follow on from? */