master - raid: avoid manipulation of segment status
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d0fe3ec0c58ccd5dfcc4f5fd40ddabab0c9defe5 Commit: d0fe3ec0c58ccd5dfcc4f5fd40ddabab0c9defe5 Parent: d1e398c474032716679f704008026b5d17e9469a Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Dec 13 14:52:06 2016 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Dec 13 22:07:52 2016 +0100
raid: avoid manipulation of segment status
RAID is LV property
TODO: only 2 flags are seg->status: PVMOVE & MERGING At least the second one should be soon elimanted as again we merge LV not a segment.
--- WHATS_NEW | 1 + lib/metadata/raid_manip.c | 6 ++---- lib/raid/raid.c | 1 - 3 files changed, 3 insertions(+), 5 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.169 - ===================================== + Do not use LV RAID status bit for segment status. Check segtype directly instead of checking RAID in segment status. Reusing exiting code for raid image removal. Fix pvmove leaving -pvmove0 error device in clustered VG.
lib/metadata/raid_manip.c +2 -4
@@ -1701,7 +1701,7 @@ static int _alloc_and_add_new_striped_segment(struct logical_volume *lv,/* Allocate a segment with seg->area_count areas */ if (!(new_seg =alloc_lv_segment (striped_segtype, lv, le, area_len * seg->area_count, - seg->status & ~RAID , +0 , seg->stripe_size,NULL , seg->area_count, area_len, seg->chunk_size,0 ,0 ,NULL ))) return_0;
@@ -2150,7 +2150,6 @@ static int _convert_mirror_to_raid1(struct logical_volume *lv, lv->status &= ~MIRROR ; lv->status &= ~MIRRORED ; lv->status |=RAID ; - seg->status |=RAID ;if (!lv_update_and_reload (lv)) return_0;
@@ -2220,7 +2219,6 @@ static int _convert_raid1_to_mirror(struct logical_volume *lv, seg->segtype = new_segtype; seg->region_size = new_region_size; lv->status &= ~RAID ; - seg->status &= ~RAID ; lv->status |= (MIRROR |MIRRORED );if (!attach_mirror_log (first_seg (lv), log_lv))
@@ -2473,7 +2471,7 @@ static struct lv_segment *_convert_striped_to_raid0(struct logical_volume *lv, seg = first_seg(dm_list_item(dm_list_first(&data_lvs), struct lv_list)->lv); if (!(raid0_seg = alloc_lv_segment(segtype, lv, 0 /* le */, lv->le_count /* len */, - seg->status | SEG_RAID, + 0, stripe_size, NULL /* log_lv */, area_count, area_len, 0 /* chunk_size */,
lib/raid/raid.c +0 -1
@@ -167,7 +167,6 @@ static int _raid_text_import(struct lv_segment *seg,if (seg_is_any_raid0 (seg)) seg->area_len /= seg->area_count; - seg->status |=RAID ;return 1 ; }