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:
parent
d1e398c474
commit
d0fe3ec0c5
@ -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.
|
||||
|
@ -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 */,
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user