From: Yehuda Sadeh Date: Tue, 1 Oct 2013 20:32:08 +0000 (-0700) Subject: rgw: fix qutoa check X-Git-Tag: v0.72-rc1~65^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=81aa478c13a21c088f95d909f9be3af8901a3adb;p=ceph.git rgw: fix qutoa check size is in kb Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index 56ce60f56b92..694fcc61dd10 100644 --- a/src/rgw/rgw_quota.cc +++ b/src/rgw/rgw_quota.cc @@ -100,6 +100,7 @@ public: RGWQuotaHandlerImpl(RGWRados *store) : stats_cache(store) {} virtual int check_quota(rgw_bucket& bucket, RGWQuotaInfo& bucket_quota, uint64_t num_objs, uint64_t size) { + uint64_t size_kb = rgw_rounded_kb(size); if (!bucket_quota.enabled) { return 0; } @@ -115,7 +116,7 @@ public: return -ERR_QUOTA_EXCEEDED; } if (bucket_quota.max_size_kb && - stats.num_kb_rounded + size > bucket_quota.max_size_kb) { + stats.num_kb_rounded + size_kb > bucket_quota.max_size_kb) { return -ERR_QUOTA_EXCEEDED; }