]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/api: ImageCtx must be closed instead of deleted
authorJason Dillaman <dillaman@redhat.com>
Tue, 20 Oct 2020 06:55:36 +0000 (02:55 -0400)
committerJason Dillaman <dillaman@redhat.com>
Sun, 1 Nov 2020 14:22:38 +0000 (09:22 -0500)
On error, the destination image context will need to be properly
closed instead of just deleted.

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

index d3c1e0479b010f63bb7459ec0dea2eeac3a8e13d..565257168ebdc4185f96ea177ce153768d162828 100644 (file)
@@ -753,7 +753,7 @@ int Migration<I>::prepare() {
 
   BOOST_SCOPE_EXIT_TPL(&m_dst_image_ctx) {
     if (m_dst_image_ctx != nullptr) {
-      delete m_dst_image_ctx;
+      m_dst_image_ctx->state->close();
     }
   } BOOST_SCOPE_EXIT_END;