diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-10-01 13:37:56 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-10-01 13:37:56 -0700 |
commit | 6fcea1a0ec6c69308bd2d8116ffa7f9c132f2c18 (patch) | |
tree | 334ee2f9ebec3d9f4ad049bbc7c503daf50b77af | |
parent | 76284fa31c0d5e89e5451d3364003eec4adf7323 (diff) | |
download | ceph-6fcea1a0ec6c69308bd2d8116ffa7f9c132f2c18.tar.gz |
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 <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_op.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 4dd6bf39a26..c5a0c1c1a77 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'; |