Skip to content

Commit

Permalink
Merge pull request #24507 from pdvian/wip-36212-luminous
Browse files Browse the repository at this point in the history
luminous: rgw: RGWAsyncGetBucketInstanceInfo does not access coroutine memory

Reviewed-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
yuriw committed Nov 1, 2018
2 parents c738678 + c1cfbb8 commit 7bf0674
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/rgw/rgw_cr_rados.cc
Expand Up @@ -498,7 +498,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;
Expand Down
14 changes: 8 additions & 6 deletions src/rgw/rgw_cr_rados.h
Expand Up @@ -654,16 +654,15 @@ class RGWShardedOmapCRManager {
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 {
Expand Down Expand Up @@ -698,11 +697,14 @@ class RGWGetBucketInstanceInfoCR : public RGWSimpleCoroutine {
}

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();
}
};
Expand Down

0 comments on commit 7bf0674

Please sign in to comment.