summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-04-11 12:40:03 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2012-04-11 12:40:03 +0000
commit5dc27b75ebdafaa011b4b081e42a035c55d030dd (patch)
tree8f01eaea40b0803f3c201854df0d819bb54ecc87 /tools
parent6fc1f948c2147d217ad104448e3585d6203f742e (diff)
downloadlvm2-5dc27b75ebdafaa011b4b081e42a035c55d030dd.tar.gz
lvm2-5dc27b75ebdafaa011b4b081e42a035c55d030dd.tar.xz
lvm2-5dc27b75ebdafaa011b4b081e42a035c55d030dd.zip
Fix lvresize for thin pool
When resizing thin pool - we need to use strip info from _tdata volume. In future more generic solution will be necessary once we start to support lvconvert (resize of stacked devices and stay properly aligned). For now we just allow striped or linear LV so this code will work.
Diffstat (limited to 'tools')
-rw-r--r--tools/lvresize.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c
index b71720e3..4acdda22 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -590,7 +590,10 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
if ((lp->extents > lv->le_count) &&
!(lp->stripes == 1 || (lp->stripes > 1 && lp->stripe_size))) {
/* FIXME Don't assume mirror seg will always be AREA_LV */
- dm_list_iterate_items(seg, seg_mirrors ? &seg_lv(mirr_seg, 0)->segments : &lv->segments) {
+ /* FIXME We will need to support resize for metadata LV as well,
+ * 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))
continue;
@@ -739,13 +742,6 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
log_warn("Thin pool volumes do not have filesystem.");
lp->resizefs = 0;
}
-
- if (!lp->stripes) {
- /* Try to use the same strip settings for underlying pool data LV */
- lp->stripes = last_seg(seg_lv(first_seg(lv), 0))->area_count;
- if (!lp->stripe_size)
- lp->stripe_size = last_seg(seg_lv(first_seg(lv), 0))->stripe_size;
- }
}
if ((lp->resize == LV_REDUCE) && lp->argc)