diff options
author | Milan Broz <mbroz@redhat.com> | 2009-03-16 14:34:57 +0000 |
---|---|---|
committer | Milan Broz <mbroz@redhat.com> | 2009-03-16 14:34:57 +0000 |
commit | 7f436a0f39c77ad2dbe175c94c1ac77842057529 (patch) | |
tree | d1317d192070969ecd5d0eda120fe4b4194dd6a9 /tools/lvcreate.c | |
parent | 470304e2a234dd63816f55c055d76ca6b0ce2743 (diff) | |
download | lvm2-7f436a0f39c77ad2dbe175c94c1ac77842057529.tar.gz lvm2-7f436a0f39c77ad2dbe175c94c1ac77842057529.tar.xz lvm2-7f436a0f39c77ad2dbe175c94c1ac77842057529.zip |
Fix lv_count when manipulating with snapshots and max_lv is set.
Patch fixes these problems:
- during the snapshot creation process, it needs create 2 LVs,
one is cow, second becomes snapshot.
If the code fails in vg_add_snapshot, code lvcreate will not remove
LV cow volume.
- if max_lv is set and VG contains snapshot, it can happen that
during the activation lv_count is temporarily increased over the limit
and VG metadata are not properly processed
see https://bugzilla.redhat.com/show_bug.cgi?id=490298
- vgcfgrestore alows restore with max_lv set to lower valuer that actual
LV count. This later leads to situation that max_lv is completely ignored.
- vgck doesn't call vg_validate(). It should at least try:-)
Signed-off-by: Milan Broz <mbroz@redhat.com>
Diffstat (limited to 'tools/lvcreate.c')
-rw-r--r-- | tools/lvcreate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 1f14eb1d..e25ecdd5 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -836,7 +836,7 @@ static int _lvcreate(struct cmd_context *cmd, struct volume_group *vg, if (!vg_add_snapshot(NULL, org, lv, NULL, org->le_count, lp->chunk_size)) { log_error("Couldn't create snapshot."); - return 0; + goto deactivate_and_revert_new_lv; } /* store vg on disk(s) */ |