diff options
author | Petr Rockai <prockai@redhat.com> | 2011-09-15 18:51:11 +0000 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2011-09-15 18:51:11 +0000 |
commit | 44dfb51f2a9bc727e340d58772d3d8c3c2a54784 (patch) | |
tree | 76766ea54f57aa8c40725f9513d504c67ec6a37d /tools/lvresize.c | |
parent | b18e1fd50efb2d743907582d3aa665d0702b899e (diff) | |
download | lvm2-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.c | 3 |
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 + |