summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-06-26 09:44:54 -0500
committerJonathan Brassow <jbrassow@redhat.com>2012-06-26 09:44:54 -0500
commit8767435ef847831455fadc1f7e8f4d2d94aef0d5 (patch)
tree8c3d3b3c0d12a55fab388ed9cf1a9919e8815720 /tools
parentbf81d5607a47eb0bf3963be54f4b765b2d24b895 (diff)
downloadlvm2-8767435ef847831455fadc1f7e8f4d2d94aef0d5.tar.gz
lvm2-8767435ef847831455fadc1f7e8f4d2d94aef0d5.tar.xz
lvm2-8767435ef847831455fadc1f7e8f4d2d94aef0d5.zip
RAID: Fix extending size of RAID 4/5/6 logical volumes.
Reducing a RAID 4/5/6 LV or extending it with a different number of stripes is still not implemented. This patch covers the "simple" case where the LV is extended with the same number of stripes as the orginal.
Diffstat (limited to 'tools')
-rw-r--r--tools/lvresize.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c
index 55d1334d..64474e07 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -598,11 +598,12 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
* and data LV could be any type (i.e. mirror)) */
dm_list_iterate_items(seg, seg_mirrors ? &seg_lv(mirr_seg, 0)->segments :
lv_is_thin_pool(lv) ? &seg_lv(first_seg(lv), 0)->segments : &lv->segments) {
- if (!seg_is_striped(seg))
+ if (!seg_is_striped(seg) &&
+ (!seg_is_raid(seg) || seg_is_mirrored(seg)))
continue;
sz = seg->stripe_size;
- str = seg->area_count;
+ str = seg->area_count - lp->segtype->parity_devs;
if ((seg_stripesize && seg_stripesize != sz &&
sz && !lp->stripe_size) ||
@@ -618,6 +619,11 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
if (!lp->stripes)
lp->stripes = seg_stripes;
+ else if (seg_is_raid(first_seg(lv)) &&
+ (lp->stripes != seg_stripes)) {
+ log_error("Unable to extend \"%s\" segment type with different number of stripes.", first_seg(lv)->segtype->name);
+ return ECMD_FAILED;
+ }
if (!lp->stripe_size && lp->stripes > 1) {
if (seg_stripesize) {