mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Lvresize rounds upward
When given lvresize new size - round upward for stripes - unless we use % and we are at the border of free extents. This patch is not a complete fix and few more cases will need special care.
This commit is contained in:
parent
c6f3701a71
commit
6fc1f948c2
@ -1,5 +1,6 @@
|
||||
Version 2.02.96 -
|
||||
================================
|
||||
For lvresize round upward when specifying number of extents.
|
||||
For lvcreate with %FREE support rounding downward strip alignment.
|
||||
Change message severity to log_very_verbose for missing dev info in udev db.
|
||||
Fix problems when specifying PVs during RAID down-converts.
|
||||
|
@ -676,7 +676,11 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
||||
|
||||
size_rest = seg_size % (lp->stripes * stripesize_extents);
|
||||
/* Round toward the original size. */
|
||||
if (size_rest && lp->extents < lv->le_count) {
|
||||
if (size_rest &&
|
||||
((lp->extents < lv->le_count) ||
|
||||
!lp->percent ||
|
||||
(vg->free_count >= (lp->extents - lv->le_count - size_rest +
|
||||
(lp->stripes * stripesize_extents))))) {
|
||||
log_print("Rounding size (%d extents) up to stripe "
|
||||
"boundary size for segment (%d extents)",
|
||||
lp->extents, lp->extents - size_rest +
|
||||
@ -689,7 +693,6 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
|
||||
lp->extents, lp->extents - size_rest);
|
||||
lp->extents = lp->extents - size_rest;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (lp->extents < lv->le_count) {
|
||||
|
Loading…
Reference in New Issue
Block a user