]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: migration execute should allow "EXECUTING" state
authorJason Dillaman <dillaman@redhat.com>
Wed, 21 Oct 2020 19:39:34 +0000 (15:39 -0400)
committerJason Dillaman <dillaman@redhat.com>
Sun, 1 Nov 2020 14:22:38 +0000 (09:22 -0500)
If the "execute" action was interrupted, we need to be able to
restart it.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/api/Migration.cc

index d700bb36f4e898612f99636fa9bdc2060b9f7dfd..fa0aaaa95d2b6105feb6e8410a0b4fa02f3afdb7 100644 (file)
@@ -633,7 +633,8 @@ int Migration<I>::execute(librados::IoCtx& io_ctx,
     }
   } BOOST_SCOPE_EXIT_END;
 
-  if (dst_migration_spec.state != cls::rbd::MIGRATION_STATE_PREPARED) {
+  if (dst_migration_spec.state != cls::rbd::MIGRATION_STATE_PREPARED &&
+      dst_migration_spec.state != cls::rbd::MIGRATION_STATE_EXECUTING) {
     lderr(cct) << "current migration state is '" << dst_migration_spec.state
                << "' (should be 'prepared')" << dendl;
     return -EINVAL;