]> git.apps.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>
Tue, 14 Mar 2017 13:54:18 +0000 (09:54 -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>
(cherry picked from commit 5cc599b9bf2dde31de16a5b2831baf06851d69d5)

 Conflicts:
src/rgw/rgw_data_sync.cc: declaration of 'int r'

src/rgw/rgw_data_sync.cc

index e92f783eac861b0c66a3b97eb5ac83df76a1ff35..46433d4542c42e685b0d6f67fe303423845084b6 100644 (file)
@@ -1494,16 +1494,17 @@ 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);
   lock.unlock();
+
   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;
 }