From 0be4e89419f2083d081ac784891e4653290cd530 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 11 Oct 2016 15:21:42 -0400 Subject: [PATCH] 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) --- src/rgw/rgw_data_sync.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 46433d4542c42..de1f153d6a164 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(); -- 2.39.5