From: 9seconds Date: Wed, 1 Apr 2015 06:12:06 +0000 (+0300) Subject: rgw: quota not respected in POST object X-Git-Tag: v0.94.2~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4581%2Fhead;p=ceph.git rgw: quota not respected in POST object Signed-off-by: Sergey Arkhipov Backport: hammer, firefly Fixes: #11323 (cherry picked from commit e76f84e179d2ba8bfc0dc5abf4e620fef14bc8a0) Conflicts: src/rgw/rgw_op.cc discard the whitespace modification hunk that were creating conflict and ignore the conflict due to an unrelated cast modification in the context --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 3ec8dbae0826..86c8bb346604 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1944,6 +1944,12 @@ void RGWPostObj::execute() goto done; } + ret = store->check_quota(s->bucket_owner.get_id(), s->bucket, + user_quota, bucket_quota, s->content_length); + if (ret < 0) { + goto done; + } + processor = select_processor(*(RGWObjectCtx *)s->obj_ctx); ret = processor->prepare(store, NULL); @@ -1979,6 +1985,12 @@ void RGWPostObj::execute() s->obj_size = ofs; + ret = store->check_quota(s->bucket_owner.get_id(), s->bucket, + user_quota, bucket_quota, s->obj_size); + if (ret < 0) { + goto done; + } + hash.Final(m); buf_to_hex(m, CEPH_CRYPTO_MD5_DIGESTSIZE, calc_md5);