]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: hold a reference on data_sync_cr over run() 11506/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 11 Oct 2016 19:21:42 +0000 (15:21 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 14 Oct 2016 20:45:10 +0000 (16:45 -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>
src/rgw/rgw_data_sync.cc

index e4cdfbe929683eb640814a223fef12b919f8c763..a2de5bda64ec5bf8a74037e918569201d7aaf73d 100644 (file)
@@ -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();