]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: properly initialize image copy start/end objects
authorJason Dillaman <dillaman@redhat.com>
Tue, 22 Mar 2016 22:51:34 +0000 (18:51 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 29 Mar 2016 19:12:29 +0000 (15:12 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/image_sync/ImageCopyRequest.cc

index aedf2f5321d0f85da10d46f530779abd441329df..e22eb5f3158c796eb933380cfc6df7aba71988b2 100644 (file)
@@ -69,7 +69,7 @@ void ImageCopyRequest<I>::send_update_max_object_count() {
     }
   }
 
-  if (max_objects == m_client_meta->sync_object_count) {
+  if (max_objects <= m_client_meta->sync_object_count) {
     send_object_copies();
     return;
   }
@@ -103,11 +103,6 @@ void ImageCopyRequest<I>::handle_update_max_object_count(int r) {
 
   // update provided meta structure to reflect reality
   m_client_meta->sync_object_count = m_client_meta_copy.sync_object_count;
-  m_object_no = 0;
-  if (m_sync_point->object_number) {
-    m_object_no = *m_sync_point->object_number + 1;
-  }
-  m_end_object_no = m_client_meta_copy.sync_object_count;
 
   send_object_copies();
 }
@@ -115,6 +110,16 @@ void ImageCopyRequest<I>::handle_update_max_object_count(int r) {
 template <typename I>
 void ImageCopyRequest<I>::send_object_copies() {
   CephContext *cct = m_local_image_ctx->cct;
+
+  m_object_no = 0;
+  if (m_sync_point->object_number) {
+    m_object_no = *m_sync_point->object_number + 1;
+  }
+  m_end_object_no = m_client_meta->sync_object_count;
+
+  dout(20) << ": start_object=" << m_object_no << ", "
+           << "end_object=" << m_end_object_no << dendl;
+
   bool complete;
   {
     Mutex::Locker locker(m_lock);