Skip to contentSkip to conversation

master - lvcreate: delay check for free extents

PATCH Zdenek Kabelac 1 participant 1 message Oct 26, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=205e3ff88898848b6e5dcfde74bff829bd27bf83
Commit:        205e3ff88898848b6e5dcfde74bff829bd27bf83
Parent:        c9fbbf48baf9866dc57b336f9ca2b54346fb9827
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Oct 26 16:18:53 2014 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sun Oct 26 18:37:13 2014 +0100

lvcreate: delay check for free extents

As the rounding for cache creation may change the value of extents postpone check for free extents.

---
 lib/metadata/lv_manip.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
lib/metadata/lv_manip.c +8 -8
index 1ab47c6..36bc2d8 100644
@@ -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;