]> sourceware.org Git - lvm2.git/commitdiff
Thin create normal (old) snapshot when size is specified
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 10 Nov 2011 12:39:46 +0000 (12:39 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 10 Nov 2011 12:39:46 +0000 (12:39 +0000)
tools/lvcreate.c

index ec48ae6d6ca8ee5ce33e4f09cfda9eded7d5df4d..9d035b8cbdda4942028290c74a43f4a7b2c9f1ee 100644 (file)
@@ -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;
 }
 
This page took 0.030194 seconds and 5 git commands to generate.