]> 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 24007/head
authorTianshan Qu <tianshan@xsky.com>
Mon, 10 Sep 2018 10:00:45 +0000 (18:00 +0800)
committerTianshan Qu <tianshan@xsky.com>
Mon, 10 Sep 2018 16:53:52 +0000 (00:53 +0800)
Fixes: http://tracker.ceph.com/issues/35905
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
src/rgw/rgw_cr_rados.cc
src/rgw/rgw_cr_rados.h

index 7179b572505ff338f385a537d9b7cf8cd7a50053..d87e76d8c97b67dfb14023018147b3f78bb489bb 100644 (file)
@@ -587,7 +587,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;
@@ -691,7 +691,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 b9aab807f47abcceca7db42052123a5a77d5427e..d5ee25ab112c60a306cf68bd90f6aaeb8a5dcf9d 100644 (file)
@@ -735,7 +735,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;
@@ -750,7 +750,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 {
@@ -923,7 +928,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;
@@ -948,10 +953,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;
+    }
   }
 };