]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWAsyncGetBucketInstanceInfo does not access coroutine memory 24516/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 7 Sep 2018 20:13:27 +0000 (16:13 -0400)
committerPrashant D <pdhange@redhat.com>
Wed, 10 Oct 2018 01:49:19 +0000 (21:49 -0400)
Fixes: http://tracker.ceph.com/issues/35812
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 6fb61c5ed8eb7cbe6d1271a8b61e465023d2e621)

src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h

index dbd863a5846d1871d80618f174fed5409e688c10..418b5e51e1c52813639b8229aa28a4748dd8beeb 100644 (file)
@@ -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;
index c603e20c5abb2f3b9a1e89d70116dd9fb622fdf9..dba10400ec150b0196ae2b12e1ce174c6f032cfb 100644 (file)
@@ -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();
   }
 };