summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2014-10-26 16:18:53 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2014-10-26 18:37:13 +0100
commit205e3ff88898848b6e5dcfde74bff829bd27bf83 (patch)
treeac1b49425b66205741e440ad8cf37eec171b878c
parentc9fbbf48baf9866dc57b336f9ca2b54346fb9827 (diff)
downloadlvm2-205e3ff88898848b6e5dcfde74bff829bd27bf83.tar.gz
lvcreate: delay check for free extents
As the rounding for cache creation may change the value of extents postpone check for free extents.
-rw-r--r--lib/metadata/lv_manip.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 1ab47c631..36bc2d87d 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6636,14 +6636,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
return NULL;
}
- if (!seg_is_virtual(lp) && !lp->approx_alloc &&
- (vg->free_count < lp->extents)) {
- log_error("Volume group \"%s\" has insufficient free space "
- "(%u extents): %u required.",
- vg->name, vg->free_count, lp->extents);
- return NULL;
- }
-
if ((lp->alloc != ALLOC_ANYWHERE) && (lp->stripes > dm_list_size(lp->pvh))) {
log_error("Number of stripes (%u) must not exceed "
"number of physical volumes (%d)", lp->stripes,
@@ -6836,6 +6828,14 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
lp->wipe_signatures = 0;
}
+ if (!seg_is_virtual(lp) && !lp->approx_alloc &&
+ (vg->free_count < lp->extents)) {
+ log_error("Volume group \"%s\" has insufficient free space "
+ "(%u extents): %u required.",
+ vg->name, vg->free_count, lp->extents);
+ return NULL;
+ }
+
if (!archive(vg))
return_NULL;