]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RadosBucket::get_bucket_info() updates RGWBucketEnt 45483/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 6 Jul 2021 18:20:25 +0000 (14:20 -0400)
committerCory Snyder <csnyder@iland.com>
Thu, 17 Mar 2022 13:13:50 +0000 (09:13 -0400)
if we construct a RadosBucket without knowing its instance id,
get_bucket_info() will look it up for us and store it in
info.bucket.bucket_id

but RadosBucket::update_container_stats() gets this instance id from
'RGWBucketEnt ent', which wasn't updated by get_bucket_info(). this
causes update_container_stats() to try to read a bucket instance with
empty instance id, which fails with -ENOENT, and the RGWListBucket op
returns uninitialized X-Container-* stats

Fixes: https://tracker.ceph.com/issues/47781
Fixes: https://tracker.ceph.com/issues/47861
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit e391e56c7dda24b4a9d6981a5be31fe8b9defd9d)

src/rgw/rgw_sal_rados.cc

index 28f1cef9ffefd83afbef14739677cc273d217270..9b16897215e23ae564b02b6bd218841d6dadc335 100644 (file)
@@ -192,6 +192,7 @@ int RGWRadosBucket::get_bucket_info(const DoutPrefixProvider *dpp, optional_yiel
   if (ret == 0) {
     bucket_version = ep_ot.read_version;
     ent.placement_rule = info.placement_rule;
+    ent.bucket = info.bucket; // we looked up bucket_id
   }
   return ret;
 }