From ff13206c7e6f8a4246afb562338aaba879d579ad Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 8 Oct 2012 12:06:30 +0200 Subject: [PATCH] report: call snapshot percent with cow only Ensure lv_snapshot_percent is used only with snapshot LVs. --- WHATS_NEW | 1 + lib/report/properties.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index e39a36e4e..004f8b11a 100644 --- 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. diff --git a/lib/report/properties.c b/lib/report/properties.c index 4129b01bb..c4f6ab985 100644 --- a/lib/report/properties.c +++ b/lib/report/properties.c @@ -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; }