]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: quota not respected in POST object 4240/head
author9seconds <nineseconds@yandex.ru>
Wed, 1 Apr 2015 06:12:06 +0000 (09:12 +0300)
committer9seconds <nineseconds@yandex.ru>
Tue, 7 Apr 2015 06:45:42 +0000 (09:45 +0300)
Signed-off-by: Sergey Arkhipov <nineseconds@yandex.ru>
Backport: hammer, firefly
Fixes: #11323
src/rgw/rgw_op.cc

index 24f85ac4da5f0f1a0f0f4f6178bb561b01f245b0..ecb98c7e4b9c6f43e355f7744c9f53684dde698f 100644 (file)
@@ -1218,7 +1218,7 @@ void RGWListBucket::execute()
     ret = store->update_containers_stats(m);
     if (ret > 0) {
       bucket = m.begin()->second;
-    } 
+    }
   }
 
   RGWRados::Bucket target(store, s->bucket);
@@ -1968,6 +1968,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(*static_cast<RGWObjectCtx *>(s->obj_ctx));
 
   ret = processor->prepare(store, NULL);
@@ -2003,6 +2009,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);
 
@@ -2835,7 +2847,7 @@ static int list_multipart_parts(RGWRados *store, struct req_state *s,
   int ret;
 
   parts.clear();
-  
+
   if (sorted_omap) {
     string p;
     p = "part.";