From: Casey Bodley Date: Tue, 11 Oct 2016 19:19:37 +0000 (-0400) Subject: rgw: clear data_sync_cr if RGWDataSyncControlCR fails X-Git-Tag: v10.2.7~10^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=18ffdb7baf4aff1fd7f894af1054081f3ee61d28;p=ceph.git rgw: clear data_sync_cr if RGWDataSyncControlCR fails async notifications will still try to call wakeup() on RGWDataSyncControlCR if it fails, leading to segfault Fixes: http://tracker.ceph.com/issues/17569 Signed-off-by: Casey Bodley (cherry picked from commit 5cc599b9bf2dde31de16a5b2831baf06851d69d5) Conflicts: src/rgw/rgw_data_sync.cc: declaration of 'int r' --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index e92f783eac86..46433d4542c4 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1494,16 +1494,17 @@ int RGWRemoteDataLog::run_sync(int num_shards, rgw_data_sync_status& sync_status lock.get_write(); data_sync_cr = new RGWDataSyncControlCR(&sync_env, num_shards); lock.unlock(); + r = run(data_sync_cr); - if (r < 0) { - ldout(store->ctx(), 0) << "ERROR: failed to run sync" << dendl; - return r; - } lock.get_write(); data_sync_cr = NULL; lock.unlock(); + if (r < 0) { + ldout(store->ctx(), 0) << "ERROR: failed to run sync" << dendl; + return r; + } return 0; }