summaryrefslogtreecommitdiffstats
path: root/tools/lvcreate.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-05-13 21:21:58 +0000
committerMilan Broz <mbroz@redhat.com>2009-05-13 21:21:58 +0000
commit4b13d5a8238574d9af53b9131456d1f03f8d627e (patch)
tree846c5659e0286f936b6c3e231ccb1b0edcd832f3 /tools/lvcreate.c
parent3a5d73beb06d0f9bf4b28862e3b661976656eaa1 (diff)
downloadlvm2-4b13d5a8238574d9af53b9131456d1f03f8d627e.tar.gz
lvm2-4b13d5a8238574d9af53b9131456d1f03f8d627e.tar.xz
lvm2-4b13d5a8238574d9af53b9131456d1f03f8d627e.zip
Fix snapshot segment import to not use duplicate segments & replace.
The snapshot segment (snapshotX) is created twice during the text metadata segment processing. This can cause temporary violation of max_lv count. Simplify the code, snapshot segment is properly initialized in init_snapshot_seg function now and do not need to be replaced by vg_add_snapshot call. The vg_add_snapshot() is now usefull only for adding new snapshot and it shares the same initialization function. The snapshot name is always generated, name paramater can be removed from function call.
Diffstat (limited to 'tools/lvcreate.c')
-rw-r--r--tools/lvcreate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 42608c36..069cc0e1 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -918,7 +918,7 @@ static int _lvcreate(struct cmd_context *cmd, struct volume_group *vg,
/* cow LV remains active and becomes snapshot LV */
- if (!vg_add_snapshot(NULL, org, lv, NULL,
+ if (!vg_add_snapshot(org, lv, NULL,
org->le_count, lp->chunk_size)) {
log_error("Couldn't create snapshot.");
goto deactivate_and_revert_new_lv;