From: Yehuda Sadeh Date: Tue, 1 Oct 2013 20:37:56 +0000 (-0700) Subject: rgw: also check quota before starting write X-Git-Tag: v0.72-rc1~65^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fcea1a0ec6c69308bd2d8116ffa7f9c132f2c18;p=ceph.git rgw: also check quota before starting write In that case we only do it if it's not chunked upload (for which we don't have the content length). Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 4dd6bf39a26c..c5a0c1c1a770 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1400,6 +1400,14 @@ void RGWPutObj::execute() ldout(s->cct, 15) << "supplied_md5=" << supplied_md5 << dendl; } + if (!chunked_upload) { /* with chunked upload we don't know how big is the upload. + we also check sizes at the end anyway */ + ret = store->check_quota(s->bucket, bucket_quota, s->content_length); + if (ret < 0) { + goto done; + } + } + if (supplied_etag) { strncpy(supplied_md5, supplied_etag, sizeof(supplied_md5) - 1); supplied_md5[sizeof(supplied_md5) - 1] = '\0';