if (*result < 0) {
lderr(cct) << "failed to notify quiesce: " << cpp_strerror(*result)
<< dendl;
- return this->create_context_finisher(*result);
+ save_result(result);
+ send_notify_unquiesce();
+ return nullptr;
}
std::shared_lock owner_locker{image_ctx.owner_lock};
return send_notify_unquiesce();
}
+ m_writes_blocked = true;
+
send_append_op_event();
return nullptr;
}
CephContext *cct = image_ctx.cct;
ldout(cct, 5) << this << " " << __func__ << dendl;
- image_ctx.io_image_dispatcher->unblock_writes();
+ if (m_writes_blocked) {
+ image_ctx.io_image_dispatcher->unblock_writes();
+ }
if (m_skip_notify_quiesce) {
return this->create_context_finisher(m_ret_val);
* <start>
* |
* v
- * STATE_NOTIFY_QUIESCE
- * |
- * v
- * STATE_SUSPEND_REQUESTS
- * |
- * v
+ * STATE_NOTIFY_QUIESCE * * * * * * * * * * * * *
+ * | *
+ * v *
+ * STATE_SUSPEND_REQUESTS *
+ * | *
+ * v *
* STATE_SUSPEND_AIO * * * * * * * * * * * * * * *
* | *
* v *
uint64_t m_request_id = 0;
int m_ret_val = 0;
+ bool m_writes_blocked = false;
uint64_t m_snap_id = CEPH_NOSNAP;
uint64_t m_size;
::testing::InSequence seq;
expect_notify_quiesce(mock_image_ctx, -EINVAL);
+ expect_notify_unquiesce(mock_image_ctx, 0);
C_SaferCond cond_ctx;
librbd::NoOpProgressContext prog_ctx;