From: Casey Bodley Date: Tue, 11 Oct 2016 19:21:42 +0000 (-0400) Subject: rgw: hold a reference on data_sync_cr over run() X-Git-Tag: v10.2.7~10^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13886%2Fhead;p=ceph.git rgw: hold a reference on data_sync_cr over run() run() will drop its reference to data_sync_cr, so we need to hold a reference until we can reacquire the lock Signed-off-by: Casey Bodley (cherry picked from commit 4cf0d2a768e7402e71280ca16b47353ca2a68505) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 46433d4542c4..de1f153d6a16 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1493,11 +1493,13 @@ 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); + data_sync_cr->get(); // run() will drop a ref, so take another lock.unlock(); r = run(data_sync_cr); lock.get_write(); + data_sync_cr->put(); data_sync_cr = NULL; lock.unlock();