From: Casey Bodley Date: Tue, 6 Jul 2021 18:20:25 +0000 (-0400) Subject: rgw: RadosBucket::get_bucket_info() updates RGWBucketEnt X-Git-Tag: v16.2.8~74^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b5116a85e5592d1f5144ed19cebe973178485f65;p=ceph.git 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) --- diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 28f1cef9ffef..9b16897215e2 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; }