]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: op: check for bucket existance as well in init_quota 37703/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Sun, 18 Oct 2020 22:10:42 +0000 (00:10 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Sun, 18 Oct 2020 22:10:42 +0000 (00:10 +0200)
While initializing quota, we already check for object existance, and proceed
expecting bucket to be initialized. For non S3/Swift api requests, for eg. the
admin api `s->bucket` wouldn't be initialized, so check for the bucket existance
as well before proceeding to verify bucket owner's quota.

Fixes: https://tracker.ceph.com/issues/47882
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_op.cc

index f7cc9069a233c4d1c64cfc2f9ca89d73e81c805f..58f4d040b1d6fa166600fb830db7d6dc6282aa23 100644 (file)
@@ -1299,7 +1299,8 @@ int RGWOp::init_quota()
   }
 
   /* only interested in object related ops */
-  if (rgw::sal::RGWObject::empty(s->object.get())) {
+  if (rgw::sal::RGWBucket::empty(s->bucket.get())
+      || rgw::sal::RGWObject::empty(s->object.get())) {
     return 0;
   }