From 91f24f341ab30d3712331263c7024aeedd66bf5a Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Sun, 25 Jan 2015 12:06:46 -0500 Subject: [PATCH] librbd: copy-on-read should update the object map The new copy-on-read functionality needs to update the object map when a copyup occurs for an object. Signed-off-by: Jason Dillaman --- src/librbd/CopyupRequest.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/librbd/CopyupRequest.cc b/src/librbd/CopyupRequest.cc index c22835f86814f..1d158eb591020 100644 --- a/src/librbd/CopyupRequest.cc +++ b/src/librbd/CopyupRequest.cc @@ -3,6 +3,7 @@ #include "common/ceph_context.h" #include "common/dout.h" +#include "common/errno.h" #include "common/Mutex.h" #include "librbd/AioCompletion.h" @@ -71,6 +72,14 @@ namespace librbd { std::vector snaps; snaps.insert(snaps.end(), snapc.snaps.begin(), snapc.snaps.end()); + r = m_ictx->update_object_map(m_object_no, OBJECT_EXISTS); + if (r < 0) { + lderr(m_ictx->cct) << __func__ << " " << this + << ": failed to update object map:" + << cpp_strerror(r) << dendl; + return; + } + librados::ObjectWriteOperation copyup_op; copyup_op.exec("rbd", "copyup", m_copyup_data); -- 2.39.5