master - report: call snapshot percent with cow only
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ff13206c7e6f8a4246afb562338aaba879d579ad Commit: ff13206c7e6f8a4246afb562338aaba879d579ad Parent: 5b07bd3f9116ade9bb5931485eaa260f5141db6b Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 8 12:06:30 2012 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 8 12:16:53 2012 +0200
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 deletions(-)
WHATS_NEW +1 -0
@@ -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.
lib/report/properties.c +3 -1
@@ -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; }