summaryrefslogtreecommitdiff
path: root/tools/vgck.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-03-16 14:34:57 +0000
committerMilan Broz <mbroz@redhat.com>2009-03-16 14:34:57 +0000
commit7f436a0f39c77ad2dbe175c94c1ac77842057529 (patch)
treed1317d192070969ecd5d0eda120fe4b4194dd6a9 /tools/vgck.c
parent470304e2a234dd63816f55c055d76ca6b0ce2743 (diff)
downloadlvm2-7f436a0f39c77ad2dbe175c94c1ac77842057529.tar.gz
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/vgck.c')
-rw-r--r--tools/vgck.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/vgck.c b/tools/vgck.c
index 1fb6c03c6..26eab99a8 100644
--- a/tools/vgck.c
+++ b/tools/vgck.c
@@ -33,6 +33,9 @@ static int vgck_single(struct cmd_context *cmd __attribute((unused)),
if (!vg_check_status(vg, EXPORTED_VG))
return ECMD_FAILED;
+ if (!vg_validate(vg))
+ return ECMD_FAILED;
+
return ECMD_PROCESSED;
}