master - lvconvert: add conversion from/to raid10
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=baba3f8e2a1c6f6fcfcefaa06e87872ff63cac6d Commit: baba3f8e2a1c6f6fcfcefaa06e87872ff63cac6d Parent: 68ec6940e6897192aec6480a14492a5adc6937d8 Author: Heinz Mauelshagen <[email protected]> AuthorDate: Fri Feb 10 19:10:05 2017 +0100 Committer: Heinz Mauelshagen <[email protected]> CommitterDate: Fri Feb 10 19:13:02 2017 +0100
lvconvert: add conversion from/to raid10
Add:
- conversion support from striped/raid0/raid0_meta to/from raid10; raid10 goes by the near format (same as used in creation of raid10 LVs), which groups data copies together with their original blocks (e.g. 3-way striped, 2 data copies resulting in 112233 in the first stripe followed by 445566 in the second etc.) and is limited to even numbers of legs for now
- related tests to lvconvert-raid-takeover.sh
- typo
Related: rhbz1366296
--- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 2 +- lib/metadata/raid_manip.c | 220 ++++++++++++++++++++++++++++++--- lib/metadata/segtype.h | 3 +- lib/metadata/takeover_matrix.h | 2 +- test/shell/lvconvert-raid-takeover.sh | 23 ++++- test/shell/lvresize-raid.sh | 2 +- 7 files changed, 230 insertions(+), 23 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Support striped/raid0* <-> raid10_near conversions Support shrinking of RaidLvs Support region size changes on existing RaidLVs Avoid parallel usage of cpg_mcast_joined() in clvmd with corosync.
lib/metadata/lv_manip.c +1 -1
@@ -5418,7 +5418,7 @@ int lv_resize(struct logical_volume *lv, } } -/* Ensure stipe boundary extents! */ +/* Ensure stripe boundary extents! */ if (!lp->percent &&lv_is_raid (lv)) lp->extents =_round_to_stripe_boundary(lv->vg, lp->extents, seg_is_raid1(seg) ? 0 : _raid_stripes_count(seg),
lib/metadata/raid_manip.c +202 -18
350 lines not on this page · raw message
lib/metadata/segtype.h +2 -1
@@ -50,7 +50,8 @@ struct dev_manager;#define SEG_RAID0 0x0000000000040000ULL#define SEG_RAID0_META 0x0000000000080000ULL#define SEG_RAID1 0x0000000000100000ULL -#define SEG_RAID10 0x0000000000200000ULL +#define SEG_RAID10_NEAR 0x0000000000200000ULL +#define SEG_RAID10 SEG_RAID10_NEAR#define SEG_RAID4 0x0000000000400000ULL#define SEG_RAID5_N 0x0000000000800000ULL#define SEG_RAID5_LA 0x0000000001000000ULL
lib/metadata/takeover_matrix.h +1 -1
@@ -112,7 +112,7 @@ static takeover_fn_t _takeover_fns[][11] = { /* raid1 */ { r1__lin, r1__str, r1__mir, r1__r0, r1__r0m, r1__r1, r1__r45, X , r1__r10, X , X }, /* raid4/5 */ { r45_lin, r45_str, r45_mir, r45_r0, r45_r0m, r45_r1, r45_r54, r45_r6, X , X , X }, /* raid6 */ { X , r6__str, X , r6__r0, r6__r0m, X , r6__r45, X , X , X , X }, -/* raid10 */ // { r10_lin, r10_str, r10_mir, r10_r0, r10_r0m, r10_r1, X , X , r10_r10, r10_r01, X }, + /* raid10 */ { r10_lin, r10_str, r10_mir, r10_r0, r10_r0m, r10_r1, X , X , X , X , X },/* raid01 */ // { X , r01_str, X , X , X , X , X , X , r01_r10, r01_r01, X }, /* other */ { X , X , X , X , X , X , X , X , X , X , X }, };
test/shell/lvconvert-raid-takeover.sh +22 -1
@@ -19,7 +19,7 @@ aux have_raid 1 9 0 || skip correct_raid4_layout=0 aux have_raid 1 9 1 && correct_raid4_layout=1 -aux prepare_vg 6 80 +aux prepare_vg 8 80 function _lvcreate {
@@ -242,6 +242,27 @@ _lvconvert raid0_meta raid0_meta 3 $vg $lv1 # Convert raid0_meta -> raid6_n_6 _lvconvert raid6 raid6_n_6 5 $vg $lv1 +# Convert raid6_n_6 -> striped +_lvconvert striped striped 3 $vg $lv1 + +# Convert striped -> raid10 +_lvconvert raid10 raid10 6 $vg $lv1 + +# Convert raid10 -> raid0 +_lvconvert raid0 raid0 3 $vg $lv1 + +# Convert raid0 -> raid10 +_lvconvert raid10 raid10 6 $vg $lv1 + +# Convert raid10 -> raid0 +_lvconvert raid0_meta raid0_meta 3 $vg $lv1 + +# Convert raid0_meta -> raid10 +_lvconvert raid10 raid10 6 $vg $lv1 + +# Convert raid10 -> striped +_lvconvert striped striped 3 $vg $lv1 + # Clean up lvremove -y $vg
test/shell/lvresize-raid.sh +1 -1
@@ -19,7 +19,7 @@ aux have_raid 1 3 0 || skip levels="5 6 10" aux have_raid4 && levels="0 0_meta 4 $levels" -aux prepare_pvs 6 80 +aux prepare_pvs 6 vgcreate -s 256K $vg $(cat DEVICES)