summaryrefslogtreecommitdiffstats
path: root/src/librbd
diff options
context:
space:
mode:
authorJason Dillaman <dillaman@redhat.com>2019-04-08 19:42:16 +0200
committerJason Dillaman <dillaman@redhat.com>2019-04-08 19:42:16 +0200
commite18e413b602208b38f432f4ba5bcb187fe102cb1 (patch)
treee997e86f6bea08e3df107c0a591d55417fdfdccb /src/librbd
parentlibrbd: cleaned up snap/parent lock release in read-from-parent path (diff)
downloadceph-e18e413b602208b38f432f4ba5bcb187fe102cb1.tar.xz
ceph-e18e413b602208b38f432f4ba5bcb187fe102cb1.zip
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 <dillaman@redhat.com>
Diffstat (limited to 'src/librbd')
-rw-r--r--src/librbd/io/CopyupRequest.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librbd/io/CopyupRequest.cc b/src/librbd/io/CopyupRequest.cc
index d2727dd7d64..2299d3bf341 100644
--- a/src/librbd/io/CopyupRequest.cc
+++ b/src/librbd/io/CopyupRequest.cc
@@ -552,6 +552,12 @@ bool CopyupRequest<I>::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;