]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: return ECANCELED when ImageReplayer start is canceled
authorMykola Golub <mgolub@mirantis.com>
Mon, 30 May 2016 13:24:24 +0000 (16:24 +0300)
committerMykola Golub <mgolub@mirantis.com>
Sun, 5 Jun 2016 15:48:48 +0000 (18:48 +0300)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/test/rbd_mirror/test_ImageReplayer.cc
src/tools/rbd_mirror/ImageReplayer.cc

index 58ed3654920d34ff8018af30ee6d1e9df6ef4611..6aec1dd016d864e762cc9374de1c74effe6550eb 100644 (file)
@@ -395,8 +395,8 @@ TEST_F(TestImageReplayer, StartInterrupted)
   m_replayer->stop(&stop_cond);
   int r = start_cond.wait();
   printf("start returned %d\n", r);
-  // TODO: improve the test to avoid this race  // TODO: improve the test to avoid this race
-  ASSERT_TRUE(r == -EINTR || r == 0);
+  // TODO: improve the test to avoid this race
+  ASSERT_TRUE(r == -ECANCELED || r == 0);
   ASSERT_EQ(0, stop_cond.wait());
 }
 
index defe799493069a49aced7c2405e9dd86b5d80b5a..743eb4a7d181f27f5d42934b27cfae12372a85f3 100644 (file)
@@ -512,10 +512,10 @@ void ImageReplayer<I>::on_start_fail(int r, const std::string &desc)
       {
         Mutex::Locker locker(m_lock);
         m_state = STATE_STOPPING;
-        if (r < 0 && r != -EINTR) {
+        if (r < 0 && r != -ECANCELED) {
           derr << "start failed: " << cpp_strerror(r) << dendl;
         } else {
-          dout(20) << "start interrupted" << dendl;
+          dout(20) << "start canceled" << dendl;
         }
         std::swap(m_on_start_finish, on_start_finish);
       }
@@ -536,7 +536,7 @@ bool ImageReplayer<I>::on_start_interrupted()
     return false;
   }
 
-  on_start_fail(-EINTR);
+  on_start_fail(-ECANCELED);
   return true;
 }