Merge pull request #10065 from dillaman/wip-16558

rbd-mirror: gracefully fail if object map is unavailable

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
Mykola Golub 2016-07-01 14:19:28 +03:00 committed by GitHub
commit dbe4a72fd6

View File

@ -235,6 +235,13 @@ void ObjectCopyRequest<I>::send_update_object_map() {
m_local_image_ctx->snap_lock.put_read();
finish(0);
return;
} else if (m_local_image_ctx->object_map == nullptr) {
// possible that exclusive lock was lost in background
derr << ": object map is not initialized" << dendl;
m_local_image_ctx->snap_lock.put_read();
finish(-EINVAL);
return;
}
assert(m_local_image_ctx->object_map != nullptr);