]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix qutoa check
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 1 Oct 2013 20:32:08 +0000 (13:32 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 1 Oct 2013 20:32:08 +0000 (13:32 -0700)
size is in kb

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_quota.cc

index 56ce60f56b92775223d84ae8156cb71fd29b7f82..694fcc61dd106020a0ad6f0a4f4ba826d01c9523 100644 (file)
@@ -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;
     }