From cb39f065d6eba87cf1fc2e99334322bf63092df3 Mon Sep 17 00:00:00 2001 From: gaosibei Date: Tue, 26 Sep 2017 10:19:22 +0800 Subject: [PATCH] RGW: fix a bug about inconsistent unit of comparison MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes:http://tracker.ceph.com/issues/21590 Signed-off-by: gaosibei --- src/rgw/rgw_quota.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index d94dc0ca4cf7..ce3d1265facd 100644 --- a/src/rgw/rgw_quota.cc +++ b/src/rgw/rgw_quota.cc @@ -110,10 +110,9 @@ bool RGWQuotaCache::can_use_cached_stats(RGWQuotaInfo& quota, RGWStorageStats quota.max_size_soft_threshold = quota.max_size * store->ctx()->_conf->rgw_bucket_quota_soft_threshold; } - const auto cached_stats_num_kb_rounded = rgw_rounded_kb(cached_stats.size_rounded); - if (cached_stats_num_kb_rounded >= (uint64_t)quota.max_size_soft_threshold) { + if (cached_stats.size_rounded >= (uint64_t)quota.max_size_soft_threshold) { ldout(store->ctx(), 20) << "quota: can't use cached stats, exceeded soft threshold (size): " - << cached_stats_num_kb_rounded << " >= " << quota.max_size_soft_threshold << dendl; + << cached_stats.size_rounded << " >= " << quota.max_size_soft_threshold << dendl; return false; } } -- 2.47.3