mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-28 02:50:41 +03:00
Support rounding downward for lvcreate and %
If specifying size with % and we are reaching number of free extents - round downward with stripes.
This commit is contained in:
parent
9bdff1ee5c
commit
c6f3701a71
@ -1,5 +1,6 @@
|
||||
Version 2.02.96 -
|
||||
================================
|
||||
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.
|
||||
Fix ability to handle failures in mirrored log (regression intro 2.02.89).
|
||||
|
@ -236,6 +236,8 @@ static int _update_extents_params(struct volume_group *vg,
|
||||
uint32_t pv_extent_count;
|
||||
struct logical_volume *origin = NULL;
|
||||
int changed = 0;
|
||||
uint32_t size_rest;
|
||||
uint32_t stripesize_extents;
|
||||
|
||||
if (lcp->size &&
|
||||
!(lp->extents = extents_from_size(vg->cmd, lcp->size,
|
||||
@ -294,6 +296,18 @@ static int _update_extents_params(struct volume_group *vg,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(stripesize_extents = lp->stripe_size / vg->extent_size))
|
||||
stripesize_extents = 1;
|
||||
|
||||
if ((lcp->percent != PERCENT_NONE) && lp->stripes &&
|
||||
(size_rest = lp->extents % (lp->stripes * stripesize_extents)) &&
|
||||
(vg->free_count < lp->extents - size_rest + (lp->stripes * stripesize_extents))) {
|
||||
log_print("Rounding size (%d extents) down to stripe boundary "
|
||||
"size (%d extents)", lp->extents,
|
||||
lp->extents - size_rest);
|
||||
lp->extents = lp->extents - size_rest;
|
||||
}
|
||||
|
||||
if (lp->create_thin_pool) {
|
||||
if (!arg_count(vg->cmd, poolmetadatasize_ARG)) {
|
||||
/* Defaults to nr_pool_blocks * 64b */
|
||||
|
Loading…
x
Reference in New Issue
Block a user