Skip to content

Commit

Permalink
Merge pull request #17958 from gaosibei/branch1
Browse files Browse the repository at this point in the history
RGW: fix a bug about inconsistent unit of comparison
  • Loading branch information
mdw-at-linuxbox committed Sep 30, 2017
2 parents cd6b983 + cb39f06 commit 61f292e
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 61f292e

Please sign in to comment.