mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-04 09:18:36 +03:00
raid_manip: fix data copies on mirror <-> raid1 conversions
This commit is contained in:
parent
10f5c83851
commit
6a182bf338
@ -4452,6 +4452,9 @@ int lv_extend(struct logical_volume *lv,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (segtype_is_mirrored(segtype) || segtype_is_raid1(segtype))
|
||||||
|
stripes = 1;
|
||||||
|
|
||||||
log_very_verbose("Adding segment of type %s to LV %s.", segtype->name, display_lvname(lv));
|
log_very_verbose("Adding segment of type %s to LV %s.", segtype->name, display_lvname(lv));
|
||||||
PFLA("extents=%u", extents);
|
PFLA("extents=%u", extents);
|
||||||
#if 1
|
#if 1
|
||||||
@ -5686,8 +5689,7 @@ PFL();
|
|||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
/* HM FIXME: sufficient for RAID? */
|
/* HM FIXME: sufficient for RAID? */
|
||||||
if (seg_is_raid(seg) &&
|
if (seg_is_striped_raid(seg)) {
|
||||||
!seg_is_raid1(seg)) {
|
|
||||||
unsigned stripes = seg->area_count - seg->segtype->parity_devs;
|
unsigned stripes = seg->area_count - seg->segtype->parity_devs;
|
||||||
|
|
||||||
lp->extents = _round_to_stripe_boundary(lv, lp->extents, stripes,
|
lp->extents = _round_to_stripe_boundary(lv, lp->extents, stripes,
|
||||||
|
@ -3731,6 +3731,7 @@ static int _convert_mirror_to_raid(struct logical_volume *lv,
|
|||||||
init_mirror_in_sync(1);
|
init_mirror_in_sync(1);
|
||||||
|
|
||||||
seg->segtype = new_segtype;
|
seg->segtype = new_segtype;
|
||||||
|
seg->data_copies = new_image_count;
|
||||||
lv->status &= ~(MIRROR | MIRRORED);
|
lv->status &= ~(MIRROR | MIRRORED);
|
||||||
lv->status |= RAID;
|
lv->status |= RAID;
|
||||||
seg->status |= RAID;
|
seg->status |= RAID;
|
||||||
@ -3805,6 +3806,7 @@ 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;
|
||||||
|
seg->data_copies = new_image_count;
|
||||||
lv->status &= ~RAID;
|
lv->status &= ~RAID;
|
||||||
seg->status &= ~RAID;
|
seg->status &= ~RAID;
|
||||||
lv->status |= (MIRROR | MIRRORED);
|
lv->status |= (MIRROR | MIRRORED);
|
||||||
|
Loading…
Reference in New Issue
Block a user