]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: copy-on-read should update the object map
authorJason Dillaman <dillaman@redhat.com>
Sun, 25 Jan 2015 17:06:46 +0000 (12:06 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 29 Jan 2015 02:12:53 +0000 (21:12 -0500)
The new copy-on-read functionality needs to update the
object map when a copyup occurs for an object.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/CopyupRequest.cc

index c22835f86814fa8ae7da77240ed48484e7492726..1d158eb5910206e6e2f400a226a4dc038b966d18 100644 (file)
@@ -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<librados::snap_t> 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);