1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

report: call snapshot percent with cow only

Ensure lv_snapshot_percent is used only with snapshot LVs.
This commit is contained in:
Zdenek Kabelac 2012-10-08 12:06:30 +02:00
parent 5b07bd3f91
commit ff13206c7e
2 changed files with 4 additions and 1 deletions

View File

@ -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.

View 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;
}