From: Casey Bodley Date: Fri, 7 Sep 2018 20:13:27 +0000 (-0400) Subject: rgw: RGWAsyncGetBucketInstanceInfo does not access coroutine memory X-Git-Tag: v13.2.3~142^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75ad8c4ad96e8e72b81e3e2cbcaa7a7ee91973da;p=ceph.git rgw: RGWAsyncGetBucketInstanceInfo does not access coroutine memory Fixes: http://tracker.ceph.com/issues/35812 Signed-off-by: Casey Bodley (cherry picked from commit 6fb61c5ed8eb7cbe6d1271a8b61e465023d2e621) --- diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index dbd863a5846d..418b5e51e1c5 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -491,7 +491,7 @@ bool RGWOmapAppend::finish() { int RGWAsyncGetBucketInstanceInfo::_send_request() { RGWObjectCtx obj_ctx(store); - int r = store->get_bucket_instance_from_oid(obj_ctx, oid, *bucket_info, NULL, NULL); + int r = store->get_bucket_instance_from_oid(obj_ctx, oid, bucket_info, NULL, NULL); if (r < 0) { ldout(store->ctx(), 0) << "ERROR: failed to get bucket instance info for " << oid << dendl; diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index c603e20c5abb..dba10400ec15 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -667,16 +667,15 @@ public: class RGWAsyncGetBucketInstanceInfo : public RGWAsyncRadosRequest { RGWRados *store; const std::string oid; - RGWBucketInfo *bucket_info; protected: int _send_request() override; public: RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, - RGWRados *_store, const std::string& oid, - RGWBucketInfo *_bucket_info) - : RGWAsyncRadosRequest(caller, cn), store(_store), - oid(oid), bucket_info(_bucket_info) {} + RGWRados *_store, const std::string& oid) + : RGWAsyncRadosRequest(caller, cn), store(_store), oid(oid) {} + + RGWBucketInfo bucket_info; }; class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine { @@ -711,11 +710,14 @@ public: } int send_request() override { - req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, oid, bucket_info); + req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, oid); async_rados->queue(req); return 0; } int request_complete() override { + if (bucket_info) { + *bucket_info = std::move(req->bucket_info); + } return req->get_ret_status(); } };