]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: quota not respected in POST object 4642/head
author9seconds <nineseconds@yandex.ru>
Wed, 1 Apr 2015 06:12:06 +0000 (09:12 +0300)
committerNathan Cutler <ncutler@suse.cz>
Sun, 10 May 2015 17:43:11 +0000 (19:43 +0200)
Signed-off-by: Sergey Arkhipov <nineseconds@yandex.ru>
Backport: hammer, firefly
Fixes: #11323
(cherry picked from commit e76f84e179d2ba8bfc0dc5abf4e620fef14bc8a0)

Conflicts:
src/rgw/rgw_op.cc
        discard the whitespace modification hunks that were creating
        conflicts and ignore the conflict due to an unrelated cast
        modification in the context

src/rgw/rgw_op.cc

index d436e3a67e06877a0d21e42a78e2a442976dfd48..2eef5b0d5e8099dbe6475b418e45081340c73a77 100644 (file)
@@ -1789,6 +1789,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();
 
   ret = processor->prepare(store, s->obj_ctx, NULL);
@@ -1824,6 +1830,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);