From b5116a85e5592d1f5144ed19cebe973178485f65 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 6 Jul 2021 14:20:25 -0400 Subject: [PATCH] rgw: RadosBucket::get_bucket_info() updates RGWBucketEnt 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 (cherry picked from commit e391e56c7dda24b4a9d6981a5be31fe8b9defd9d) --- src/rgw/rgw_sal_rados.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 28f1cef9ffefd..9b16897215e23 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -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; } -- 2.39.5