From: Tianshan Qu Date: Mon, 10 Sep 2018 10:00:45 +0000 (+0800) Subject: rgw: async sync_object and remove_object does not access coroutine memory X-Git-Tag: v13.2.3~129^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24417%2Fhead;p=ceph.git rgw: async sync_object and remove_object does not access coroutine memory Fixes: http://tracker.ceph.com/issues/35905 Signed-off-by: Tianshan Qu (cherry picked from commit 2d38306e9333772a21ffdc9d92838e3b6b5c3148) --- diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index dbd863a5846d..c1898b5388f5 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -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) { diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index c603e20c5abb..9b27e0e8d767 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -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; + } } };