]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWAsyncGetBucketInstanceInfo does not access coroutine memory 24507/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 7 Sep 2018 20:13:27 +0000 (16:13 -0400)
committerPrashant D <pdhange@redhat.com>
Tue, 9 Oct 2018 21:39:14 +0000 (23:39 +0200)
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 a11b6466c5d623b1269dab0d3a438f8a4fa00826..d79188a8d4460d20f43af013c6eb34b4de36c281 100644 (file)
@@ -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;
index b18f35b5220b212c24609ef2972e512d459dfbac..42828d4119f0da6b84c8f2386b8fb1d321399640 100644 (file)
@@ -654,16 +654,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 {
@@ -698,11 +697,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();
   }
 };