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.85/lib/metadata/lv_manip.c =================================================================== --- LVM2.2.02.85.orig/lib/metadata/lv_manip.c 2011-05-23 15:59:33.000000000 +0200 +++ LVM2.2.02.85/lib/metadata/lv_manip.c 2011-05-23 15:59:42.000000000 +0200 @@ -3609,6 +3609,10 @@ int lv_create_single(struct volume_group return 0; } } + + lp->segtype = get_segtype_from_string(cmd, "striped"); + if (!lp->segtype) + return_0; } if (!lp->extents) { @@ -3642,11 +3646,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;