From 95308c5f58f37d75dab3bd9eb15a90d1e90eeda2 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 10 Nov 2011 12:39:46 +0000 Subject: Thin create normal (old) snapshot when size is specified --- tools/lvcreate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/lvcreate.c') diff --git a/tools/lvcreate.c b/tools/lvcreate.c index ec48ae6d..9d035b8c 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -204,7 +204,12 @@ static int _determine_snapshot_type(struct volume_group *vg, return 0; } - if (lv_is_thin_volume(lvl->lv)) { + if (!arg_count(vg->cmd, extents_ARG) && !arg_count(vg->cmd, size_ARG)) { + if (!lv_is_thin_volume(lvl->lv)) { + log_error("Please specify either size or extents with snapshots."); + return 0; + } + lp->thin = 1; if (!(lp->segtype = get_segtype_from_string(vg->cmd, "thin"))) return_0; @@ -212,11 +217,6 @@ static int _determine_snapshot_type(struct volume_group *vg, lp->pool = first_seg(lvl->lv)->pool_lv->name; } - if (!lp->thin && !arg_count(vg->cmd, extents_ARG) && !arg_count(vg->cmd, size_ARG)) { - log_error("Please specify either size or extents with snapshots."); - return 0; - } - return 1; } -- cgit