From: Casey Bodley Date: Fri, 22 Sep 2017 16:03:57 +0000 (-0400) Subject: rgw: dont reuse stale RGWObjectCtx for get_bucket_info() X-Git-Tag: v12.2.2~148^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37ddfc61c3376afeccfe7a8029412b9a38401bfc;p=ceph.git rgw: dont reuse stale RGWObjectCtx for get_bucket_info() if the earlier call to store->get_bucket_entrypoint_info() failed with ENOENT, the obj_ctx will cache exists=false. put_bucket_entrypoint_info() doesn't invalidate that, so this call to get_bucket_info() was reading from a stale cache and failing with ENOENT Fixes: http://tracker.ceph.com/issues/21506 Signed-off-by: Casey Bodley (cherry picked from commit 3f4f760a85f162262c5b419e9cf78966c7299f0a) --- diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 6e67d98c2d4..1c946919d78 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -2130,8 +2130,9 @@ public: /* link bucket */ if (be.linked) { + RGWObjectCtx ctx(store); RGWBucketInfo bucket_info; - ret = store->get_bucket_info(obj_ctx, tenant_name, bucket_name, + ret = store->get_bucket_info(ctx, tenant_name, bucket_name, bucket_info, nullptr, nullptr); if (ret < 0) { return ret;