diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-10-01 13:32:08 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-10-01 13:32:08 -0700 |
commit | 81aa478c13a21c088f95d909f9be3af8901a3adb (patch) | |
tree | 6bbf7b9e3c923d7629f5bcae018eb3f723fe0b4a | |
parent | bc98013f4ff7bd2be9648eedfc990dbf57bfe878 (diff) | |
download | ceph-81aa478c13a21c088f95d909f9be3af8901a3adb.tar.gz |
rgw: fix qutoa check
size is in kb
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_quota.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index 56ce60f56b9..694fcc61dd1 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; } |