]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: clear data_sync_cr if RGWDataSyncControlCR fails
authorCasey Bodley <cbodley@redhat.com>
Tue, 11 Oct 2016 19:19:37 +0000 (15:19 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 14 Oct 2016 20:45:10 +0000 (16:45 -0400)
async notifications will still try to call wakeup() on RGWDataSyncControlCR
if it fails, leading to segfault

Fixes: http://tracker.ceph.com/issues/17569
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_data_sync.cc

index 1cd2e02974c85e361ca16ab249986b546dc1f1ba..e4cdfbe929683eb640814a223fef12b919f8c763 100644 (file)
@@ -1582,16 +1582,17 @@ int RGWRemoteDataLog::run_sync(int num_shards)
   lock.get_write();
   data_sync_cr = new RGWDataSyncControlCR(&sync_env, num_shards);
   lock.unlock();
+
   int r = run(data_sync_cr);
-  if (r < 0) {
-    ldout(store->ctx(), 0) << "ERROR: failed to run sync" << dendl;
-    return r;
-  }
 
   lock.get_write();
   data_sync_cr = NULL;
   lock.unlock();
 
+  if (r < 0) {
+    ldout(store->ctx(), 0) << "ERROR: failed to run sync" << dendl;
+    return r;
+  }
   return 0;
 }