Skip to content

Commit

Permalink
RGW: fix a bug about inconsistent unit of comparison
Browse files Browse the repository at this point in the history
Fixes:http://tracker.ceph.com/issues/21590

Signed-off-by: gaosibei <gaosb@inspur.com>
  • Loading branch information
gaosibei committed Sep 29, 2017
1 parent 998bf1b commit cb39f06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/rgw/rgw_quota.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,9 @@ bool RGWQuotaCache<T>::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;
}
}
Expand Down

0 comments on commit cb39f06

Please sign in to comment.