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: v11.1.0~451^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4cf0d2a768e7402e71280ca16b47353ca2a68505;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 --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index e4cdfbe92968..a2de5bda64ec 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1581,11 +1581,13 @@ int RGWRemoteDataLog::run_sync(int num_shards) { 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(); int r = run(data_sync_cr); lock.get_write(); + data_sync_cr->put(); data_sync_cr = NULL; lock.unlock();