1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

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.
This commit is contained in:
Zdenek Kabelac 2016-12-13 14:52:06 +01:00
parent d1e398c474
commit d0fe3ec0c5
3 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.169 - Version 2.02.169 -
===================================== =====================================
Do not use LV RAID status bit for segment status.
Check segtype directly instead of checking RAID in segment status. Check segtype directly instead of checking RAID in segment status.
Reusing exiting code for raid image removal. Reusing exiting code for raid image removal.
Fix pvmove leaving -pvmove0 error device in clustered VG. Fix pvmove leaving -pvmove0 error device in clustered VG.

View File

@ -1701,7 +1701,7 @@ static int _alloc_and_add_new_striped_segment(struct logical_volume *lv,
/* Allocate a segment with seg->area_count areas */ /* Allocate a segment with seg->area_count areas */
if (!(new_seg = alloc_lv_segment(striped_segtype, lv, le, area_len * seg->area_count, 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, seg->stripe_size, NULL, seg->area_count,
area_len, seg->chunk_size, 0, 0, NULL))) area_len, seg->chunk_size, 0, 0, NULL)))
return_0; return_0;
@ -2150,7 +2150,6 @@ static int _convert_mirror_to_raid1(struct logical_volume *lv,
lv->status &= ~MIRROR; lv->status &= ~MIRROR;
lv->status &= ~MIRRORED; lv->status &= ~MIRRORED;
lv->status |= RAID; lv->status |= RAID;
seg->status |= RAID;
if (!lv_update_and_reload(lv)) if (!lv_update_and_reload(lv))
return_0; return_0;
@ -2220,7 +2219,6 @@ static int _convert_raid1_to_mirror(struct logical_volume *lv,
seg->segtype = new_segtype; seg->segtype = new_segtype;
seg->region_size = new_region_size; seg->region_size = new_region_size;
lv->status &= ~RAID; lv->status &= ~RAID;
seg->status &= ~RAID;
lv->status |= (MIRROR | MIRRORED); lv->status |= (MIRROR | MIRRORED);
if (!attach_mirror_log(first_seg(lv), log_lv)) 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); seg = first_seg(dm_list_item(dm_list_first(&data_lvs), struct lv_list)->lv);
if (!(raid0_seg = alloc_lv_segment(segtype, lv, if (!(raid0_seg = alloc_lv_segment(segtype, lv,
0 /* le */, lv->le_count /* len */, 0 /* le */, lv->le_count /* len */,
seg->status | SEG_RAID, 0,
stripe_size, NULL /* log_lv */, stripe_size, NULL /* log_lv */,
area_count, area_len, area_count, area_len,
0 /* chunk_size */, 0 /* chunk_size */,

View File

@ -167,7 +167,6 @@ static int _raid_text_import(struct lv_segment *seg,
if (seg_is_any_raid0(seg)) if (seg_is_any_raid0(seg))
seg->area_len /= seg->area_count; seg->area_len /= seg->area_count;
seg->status |= RAID;
return 1; return 1;
} }