From: Jason Dillaman Date: Tue, 20 Oct 2020 06:55:36 +0000 (-0400) Subject: librbd/api: ImageCtx must be closed instead of deleted X-Git-Tag: v16.1.0~702^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43749377cbdfa1f64e157bcb8691c55d03a5aad5;p=ceph.git librbd/api: ImageCtx must be closed instead of deleted On error, the destination image context will need to be properly closed instead of just deleted. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/api/Migration.cc b/src/librbd/api/Migration.cc index d3c1e0479b01..565257168ebd 100644 --- a/src/librbd/api/Migration.cc +++ b/src/librbd/api/Migration.cc @@ -753,7 +753,7 @@ int Migration::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;