]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: async sync_object and remove_object does not access coroutine memory 24417/head
authorTianshan Qu <tianshan@xsky.com>
Mon, 10 Sep 2018 10:00:45 +0000 (18:00 +0800)
committerPrashant D <pdhange@redhat.com>
Wed, 3 Oct 2018 22:29:36 +0000 (18:29 -0400)
Fixes: http://tracker.ceph.com/issues/35905
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit 2d38306e9333772a21ffdc9d92838e3b6b5c3148)

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

index dbd863a5846d1871d80618f174fed5409e688c10..c1898b5388f58f872df9be2d98522d8871ab1cba 100644 (file)
@@ -579,7 +579,7 @@ int RGWAsyncFetchRemoteObj::_send_request()
                        NULL, /* string *petag, */
                        NULL, /* void (*progress_cb)(off_t, void *), */
                        NULL, /* void *progress_data*); */
-                       zones_trace); 
+                       &zones_trace);
 
   if (r < 0) {
     ldout(store->ctx(), 0) << "store->fetch_remote_obj() returned r=" << r << dendl;
@@ -683,7 +683,7 @@ int RGWAsyncRemoveObj::_send_request()
   del_op.params.obj_owner.set_name(owner_display_name);
   del_op.params.mtime = timestamp;
   del_op.params.high_precision_time = true;
-  del_op.params.zones_trace = zones_trace;
+  del_op.params.zones_trace = &zones_trace;
 
   ret = del_op.delete_obj();
   if (ret < 0) {
index c603e20c5abb2f3b9a1e89d70116dd9fb622fdf9..9b27e0e8d76702a6a10cbfb26c11de376657ab62 100644 (file)
@@ -746,7 +746,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest {
   real_time src_mtime;
 
   bool copy_if_newer;
-  rgw_zone_set *zones_trace;
+  rgw_zone_set zones_trace;
 
 protected:
   int _send_request() override;
@@ -761,7 +761,12 @@ public:
                                                       bucket_info(_bucket_info),
                                                       key(_key),
                                                       versioned_epoch(_versioned_epoch),
-                                                      copy_if_newer(_if_newer), zones_trace(_zones_trace) {}
+                                                      copy_if_newer(_if_newer)
+  {
+    if (_zones_trace) {
+      zones_trace = *_zones_trace;
+    }
+  }
 };
 
 class RGWFetchRemoteObjCR : public RGWSimpleCoroutine {
@@ -934,7 +939,7 @@ class RGWAsyncRemoveObj : public RGWAsyncRadosRequest {
 
   bool del_if_older;
   ceph::real_time timestamp;
-  rgw_zone_set *zones_trace;
+  rgw_zone_set zones_trace;
 
 protected:
   int _send_request() override;
@@ -959,10 +964,14 @@ public:
                                                       versioned(_versioned),
                                                       versioned_epoch(_versioned_epoch),
                                                       del_if_older(_if_older),
-                                                      timestamp(_timestamp), zones_trace(_zones_trace) {
+                                                      timestamp(_timestamp) {
     if (_delete_marker) {
       marker_version_id = key.instance;
     }
+
+    if (_zones_trace) {
+      zones_trace = *_zones_trace;
+    }
   }
 };