]> sourceware.org Git - lvm2.git/commitdiff
report: call snapshot percent with cow only
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 8 Oct 2012 10:06:30 +0000 (12:06 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 8 Oct 2012 10:16:53 +0000 (12:16 +0200)
Ensure lv_snapshot_percent is used only with snapshot LVs.

WHATS_NEW
lib/report/properties.c

index e39a36e4ec406017b2259eb966c3dae4e32f037d..004f8b11a32560b7f5585237e41bb80c66f059b9 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.98 -
 =================================
+  Report invalid percentage for property snap_percent of non-snaphot LVs.
   Disallow convertion of thins to mirrors.
   Fix lvm2api data_percent reporting for thin volumes.
   Do not allow RAID LVs in a clustered volume group.
index 4129b01bb30795534f4a0cce99078bd3fd9d194e..c4f6ab985689fa76f0d7bbf23302a997ecd3f8ec 100644 (file)
@@ -95,8 +95,10 @@ static percent_t _copy_percent(const struct logical_volume *lv) {
 
 static percent_t _snap_percent(const struct logical_volume *lv) {
        percent_t perc;
-       if (!lv_snapshot_percent(lv, &perc))
+
+       if (!lv_is_cow(lv) || !lv_snapshot_percent(lv, &perc))
                perc = PERCENT_INVALID;
+
        return perc;
 }
 
This page took 0.042712 seconds and 5 git commands to generate.