Move the setting of the segtype upward, before testing free space. So far, this patch has no effect, but it is needed for further patches that create the individual virtual snapshots. The reason is this: if shared store already exists, we create a virtual snapshot. This is virtual segtype that allocates no space. If there is no shared store, we must create the shared store on the top of linear segment that allocates space. We need to move setting segtype before test for free space (vg->free_count < lp->extents) because virtual segments shouldn't be tested. Signed-off-by: Mikulas Patocka --- lib/metadata/lv_manip.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) Index: LVM2.2.02.60/lib/metadata/lv_manip.c =================================================================== --- LVM2.2.02.60.orig/lib/metadata/lv_manip.c 2010-02-10 22:42:45.000000000 +0100 +++ LVM2.2.02.60/lib/metadata/lv_manip.c 2010-02-10 23:07:10.000000000 +0100 @@ -2993,6 +2993,10 @@ int lv_create_single(struct volume_group } origin_active = info.exists; } + + lp->segtype = get_segtype_from_string(cmd, "striped"); + if (!lp->segtype) + return_0; } if (!lp->extents) { @@ -3020,11 +3024,6 @@ int lv_create_single(struct volume_group return 0; } - /* The snapshot segment gets created later */ - if (lp->snapshot && - !(lp->segtype = get_segtype_from_string(cmd, "striped"))) - return_0; - if (!archive(vg)) return 0;