]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: async sync_object and remove_object does not access coroutine memory 24397/head
authorTianshan Qu <tianshan@xsky.com>
Mon, 10 Sep 2018 10:00:45 +0000 (18:00 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 3 Oct 2018 12:21:37 +0000 (14:21 +0200)
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 410cbfb48b1d2d1d2667c6cac658ae2a7d6406a7..a11b6466c5d623b1269dab0d3a438f8a4fa00826 100644 (file)
@@ -586,7 +586,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;
@@ -689,7 +689,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 f26d59881c716ce0c4cdf8ae25922dc980520f58..b18f35b5220b212c24609ef2972e512d459dfbac 100644 (file)
@@ -733,7 +733,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;
@@ -748,7 +748,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 {
@@ -909,7 +914,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;
@@ -934,10 +939,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;
+    }
   }
 };