From: Jason Dillaman Date: Mon, 8 Apr 2019 17:42:16 +0000 (-0400) Subject: librbd: force a copyup object map update if migration completes X-Git-Tag: v15.1.0~2975^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F27357%2Fhead;p=ceph.git librbd: force a copyup object map update if migration completes If a live-migration copyup was in-progress when the copyup completes, force the object map to be updated. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/CopyupRequest.cc b/src/librbd/io/CopyupRequest.cc index d2727dd7d64b..2299d3bf3419 100644 --- a/src/librbd/io/CopyupRequest.cc +++ b/src/librbd/io/CopyupRequest.cc @@ -552,6 +552,12 @@ bool CopyupRequest::is_update_object_map_required(int r) { return false; } + if (m_image_ctx->migration_info.empty()) { + // migration might have completed while IO was in-flight, + // assume worst-case and perform an object map update + return true; + } + auto it = m_image_ctx->migration_info.snap_map.find(CEPH_NOSNAP); ceph_assert(it != m_image_ctx->migration_info.snap_map.end()); return it->second[0] != CEPH_NOSNAP;