}
using klass = RefreshParentRequest<I>;
- Context *ctx = create_context_callback<
- klass, &klass::handle_open_parent, false>(this);
+ Context *ctx = create_async_context_callback(
+ m_child_image_ctx, create_context_callback<
+ klass, &klass::handle_open_parent, false>(this));
OpenRequest<I> *req = OpenRequest<I>::create(m_parent_image_ctx, ctx);
req->send();
}
if (*result < 0) {
lderr(cct) << "failed to open parent image: " << cpp_strerror(*result)
<< dendl;
- send_close_parent();
- return nullptr;
+
+ // image already closed by open state machine
+ delete m_parent_image_ctx;
+ m_parent_image_ctx = nullptr;
+
+ return m_on_finish;
}
send_set_parent_snap();
* <start>
* |
* | (open required)
- * |----------------> OPEN_PARENT * * * * * * * *
- * | | *
- * | v * (on error)
- * | SET_PARENT_SNAP * * * * * *
- * | | *
- * | v *
- * \----------------> <apply> *
- * | *
- * | (close required) v
- * |-----------------> CLOSE_PARENT
- * | |
- * | v
- * \-----------------> <finish>
+ * |----------------> OPEN_PARENT * * * * * * * * * * * * * * *
+ * | | *
+ * | v *
+ * | SET_PARENT_SNAP * * * * * * *
+ * | | * *
+ * | v * (on error) *
+ * \----------------> <apply> * *
+ * | * *
+ * | (close required) v *
+ * |-----------------> CLOSE_PARENT *
+ * | | *
+ * | v *
+ * \-----------------> <finish> < * * * *
*
* @endverbatim
*/