]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: hold a reference on data_sync_cr over run() 13886/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 11 Oct 2016 19:21:42 +0000 (15:21 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 14 Mar 2017 13:54:22 +0000 (09:54 -0400)
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 <cbodley@redhat.com>
(cherry picked from commit 4cf0d2a768e7402e71280ca16b47353ca2a68505)

src/rgw/rgw_data_sync.cc

index 46433d4542c42e685b0d6f67fe303423845084b6..de1f153d6a1640ce6631ae61327bfeeb3ef5d5cc 100644 (file)
@@ -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();