]> git.apps.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)
committerJason Dillaman <dillaman@redhat.com>
Thu, 9 Jun 2016 18:11:45 +0000 (14:11 -0400)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(cherry picked from commit f581dbcb2eca108ce9440629b8f00f3229c07b95)

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 5db2f43c660e10b27298d877b43bcc69e3e3fa10..5c4920c10ddc7b6da6782f46845f5c0078a25b16 100644 (file)
@@ -513,10 +513,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);
       }
@@ -537,7 +537,7 @@ bool ImageReplayer<I>::on_start_interrupted()
     return false;
   }
 
-  on_start_fail(-EINTR);
+  on_start_fail(-ECANCELED);
   return true;
 }