]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: resync was possible only when image replayer start had succeeded
authorMykola Golub <mgolub@mirantis.com>
Wed, 10 Aug 2016 08:22:16 +0000 (11:22 +0300)
committerJason Dillaman <dillaman@redhat.com>
Tue, 11 Oct 2016 16:40:51 +0000 (12:40 -0400)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit 4bf6912f3c75560b89324fc29286028750f122c1)

src/tools/rbd_mirror/ImageReplayer.cc

index 86da4bc7dc42e584a4f41dfd9b3a7a715c5b0db1..83c30a29c2e9d0873421f69cfc7fec183469d129 100644 (file)
@@ -454,7 +454,14 @@ void ImageReplayer<I>::handle_bootstrap(int r) {
 
     if (do_resync) {
       Context *on_finish = m_on_start_finish;
+      m_stopping_for_resync = true;
       FunctionContext *ctx = new FunctionContext([this, on_finish](int r) {
+         if (r < 0) {
+           if (on_finish) {
+             on_finish->complete(r);
+           }
+           return;
+         }
           resync_image(on_finish);
         });
       m_on_start_finish = ctx;