From 8966edd2fba7ace36bb3eebfbb556a1ece550fa8 Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Thu, 10 Mar 2022 15:01:38 -0500 Subject: [PATCH] RGW - Get quota on OPs with a bucket Bucket head OPs should have quota in the output. However, we were only fetching quota on OPs that also had an object. The object itself is not necessary for quota (although a bucket is). Change it so that we get quota on bucket OPs as well. Fixes https://tracker.ceph.com/issues/54488 Signed-off-by: Daniel Gryniewicz --- src/rgw/rgw_op.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 89dbe92a2c8c0..d020d348adf78 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1350,9 +1350,8 @@ int RGWOp::init_quota() return 0; } - /* only interested in object related ops */ - if (rgw::sal::Bucket::empty(s->bucket.get()) - || rgw::sal::Object::empty(s->object.get())) { + /* Need a bucket to get quota */ + if (rgw::sal::Bucket::empty(s->bucket.get())) { return 0; } -- 2.39.5