[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH] liblvm2app: correctly return "data_percent" property for thin volumes



Signed-off-by: Tony Asleson <tasleson redhat com>
---
 lib/report/properties.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/report/properties.c b/lib/report/properties.c
index d2eac5e..677781a 100644
--- a/lib/report/properties.c
+++ b/lib/report/properties.c
@@ -104,7 +104,11 @@ static percent_t _data_percent(const struct logical_volume *lv)
 {
 	percent_t perc;
 
-	return lv_thin_pool_percent(lv, 0, &perc) ? perc : PERCENT_INVALID;
+	if ( lv_is_thin_pool(lv) ) {
+		return lv_thin_pool_percent(lv, 0, &perc) ? perc : PERCENT_INVALID;
+	} else {
+		return lv_thin_percent(lv, 0, &perc) ? perc : PERCENT_INVALID;
+	}
 }
 
 static percent_t _metadata_percent(const struct logical_volume *lv)
-- 
1.7.11.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]