return;
}
- if (m_mirror_image.mode != cls::rbd::MIRROR_IMAGE_MODE_JOURNAL) {
- dout(5) << ": local image is in unsupported mode: " << m_mirror_image.mode
- << dendl;
- send_close_image(-EOPNOTSUPP);
- return;
- }
-
// if the local image owns the tag -- don't steal the lock since
// we aren't going to mirror peer data into this image anyway
if (m_promotion_state == librbd::mirror::PROMOTION_STATE_PRIMARY) {
template <typename I>
void OpenLocalImageRequest<I>::send_lock_image() {
- dout(20) << dendl;
-
std::shared_lock owner_locker{(*m_local_image_ctx)->owner_lock};
if ((*m_local_image_ctx)->exclusive_lock == nullptr) {
- derr << ": image does not support exclusive lock" << dendl;
- send_close_image(-EINVAL);
+ owner_locker.unlock();
+ if (m_mirror_image.mode == cls::rbd::MIRROR_IMAGE_MODE_SNAPSHOT) {
+ finish(0);
+ } else {
+ derr << ": image does not support exclusive lock" << dendl;
+ send_close_image(-EINVAL);
+ }
return;
}
+ dout(20) << dendl;
+
// disallow any proxied maintenance operations before grabbing lock
(*m_local_image_ctx)->exclusive_lock->block_requests(-EROFS);