From: Abhishek Lekshmanan Date: Sun, 18 Oct 2020 22:10:42 +0000 (+0200) Subject: rgw: op: check for bucket existance as well in init_quota X-Git-Tag: v16.1.0~691^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11467af5cc235f53d22fc85f79cd0022a290304c;p=ceph.git rgw: op: check for bucket existance as well in init_quota 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 --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index f7cc9069a23..58f4d040b1d 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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; }