summaryrefslogtreecommitdiffstats
path: root/tools/lvresize.c
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2011-09-15 18:51:11 +0000
committerPetr Rockai <prockai@redhat.com>2011-09-15 18:51:11 +0000
commit44dfb51f2a9bc727e340d58772d3d8c3c2a54784 (patch)
tree76766ea54f57aa8c40725f9513d504c67ec6a37d /tools/lvresize.c
parentb18e1fd50efb2d743907582d3aa665d0702b899e (diff)
downloadlvm2-44dfb51f2a9bc727e340d58772d3d8c3c2a54784.tar.gz
lvm2-44dfb51f2a9bc727e340d58772d3d8c3c2a54784.tar.xz
lvm2-44dfb51f2a9bc727e340d58772d3d8c3c2a54784.zip
When resizing LVs, always round in the safe direction, regardless of whether we
were called as lvresize or lvreduce.
Diffstat (limited to 'tools/lvresize.c')
-rw-r--r--tools/lvresize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c
index 4e4b1289..ccd6c6e2 100644
--- a/tools/lvresize.c
+++ b/tools/lvresize.c
@@ -606,7 +606,8 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
stripesize_extents = 1;
size_rest = seg_size % (lp->stripes * stripesize_extents);
- if (size_rest && lp->resize == LV_REDUCE) {
+ /* Round toward the original size. */
+ if (size_rest && lp->extents < lv->le_count) {
log_print("Rounding size (%d extents) up to stripe "
"boundary size for segment (%d extents)",
lp->extents, lp->extents - size_rest +