From 6f14cd22fdb85a2b8f9d73ae419f6564c4cbc41e Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Wed, 15 Jun 2011 10:56:52 +0000 Subject: [PATCH] Fix lvreduce stripe rounding up from previous commit. --- tools/lvresize.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/lvresize.c b/tools/lvresize.c index 02f1f328a..8c23a5e35 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -609,8 +609,10 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg, if (size_rest && lp->resize == LV_REDUCE) { log_print("Rounding size (%d extents) up to stripe " "boundary size for segment (%d extents)", - lp->extents, lp->extents + size_rest); - lp->extents = lp->extents + size_rest; + lp->extents, lp->extents - size_rest + + (lp->stripes * stripesize_extents)); + lp->extents = lp->extents - size_rest + + (lp->stripes * stripesize_extents); } else if (size_rest) { log_print("Rounding size (%d extents) down to stripe " "boundary size for segment (%d extents)",