Skip to contentSkip to conversation

dev-mornfall-activate - lvcreate: update snapshot test

PATCH Petr Rockai 1 participant 1 message Jun 4, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e01fbd9d8d310c0b0ddcf58782ac2b871185ddd9
Commit:        e01fbd9d8d310c0b0ddcf58782ac2b871185ddd9
Parent:        562c678ee23e76b675a8f4682bd6d2447d1d0de7
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri May 31 11:00:29 2013 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri May 31 21:30:44 2013 +0200

lvcreate: update snapshot test

With last commit, there has been missing test for valid setting of extents - there is no need to test max size when creating thin snapshots.

---
 tools/lvcreate.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
tools/lvcreate.c +6 -1
index f56cdbd..7beaf6c 100644
@@ -300,7 +300,12 @@ static int _update_extents_params(struct volume_group *vg,
 			break;
 	}
 
-	if (lp->snapshot && lp->origin) {
+	if (lp->snapshot && lp->origin && lp->extents) {
+		if (!lp->chunk_size) {
+			log_error(INTERNAL_ERROR "Missing snapshot chunk size.");
+			return 0;
+		}
+
 		if (!origin && !(origin = find_lv(vg, lp->origin))) {
 			log_error("Couldn't find origin volume '%s'.",
 				  lp->origin);