snapshot-based mirroring needs to be able to potentially delete a
demotion snapshot during the unlink process. Previously, these
snapshots have been left while the read-only error was ignored.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
*m_image_ctx = I::create("", m_image_id, nullptr, m_io_ctx, m_read_only);
+ if (!m_read_only) {
+ // ensure non-primary images can be modified
+ (*m_image_ctx)->read_only_mask = ~librbd::IMAGE_READ_ONLY_FLAG_NON_PRIMARY;
+ }
+
Context *ctx = create_context_callback<
OpenImageRequest<I>, &OpenImageRequest<I>::handle_open_image>(
this);