From e6bb0a95789a38745137232faac82c62af1e26a5 Mon Sep 17 00:00:00 2001 From: songweibin Date: Thu, 8 Mar 2018 10:29:22 +0800 Subject: [PATCH] rbd: pool_percent_used should not divided by 100 The value of 'percent_used' in `ceph df --format=json` has already been divided by 100. Signed-off-by: songweibin --- src/tools/rbd/action/Trash.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd/action/Trash.cc b/src/tools/rbd/action/Trash.cc index b1ad5ade30e78..ef0355ac57772 100644 --- a/src/tools/rbd/action/Trash.cc +++ b/src/tools/rbd/action/Trash.cc @@ -421,7 +421,7 @@ int execute_purge (const po::variables_map &vm, for(uint8_t i = 0; i < arr.size(); ++i) { if(arr[i].get_obj()["name"] == pool_name) { json_spirit::mObject stats = arr[i].get_obj()["stats"].get_obj(); - pool_percent_used = stats["percent_used"].get_real() / 100; + pool_percent_used = stats["percent_used"].get_real(); if(pool_percent_used <= threshold) { std::cout << "rbd: pool usage is lower than or equal to " << (threshold*100) -- 2.39.5