From 18ffdb7baf4aff1fd7f894af1054081f3ee61d28 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 11 Oct 2016 15:19:37 -0400 Subject: [PATCH] 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' --- src/rgw/rgw_data_sync.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index e92f783eac861..46433d4542c42 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; } -- 2.39.5