From 8e33c4e28f5e562c68a3ad9d389723d8354dec11 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 (cherry picked from commit 8966edd2fba7ace36bb3eebfbb556a1ece550fa8) --- 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 bb0f963631bb..55e555882632 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.47.3