]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: CoR should copyup empty object to prevent future CoR attempts 4730/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 21 May 2015 20:25:37 +0000 (16:25 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 5 Jun 2015 16:24:27 +0000 (12:24 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/CopyupRequest.cc

index e8b6130f897d84ded8cf9e76ec89f44e6469ef3f..2580af1f42a5a5850558b1911ee990ba9856a834 100644 (file)
@@ -104,8 +104,9 @@ private:
     bool add_copyup_op = !m_copyup_data.is_zero();
     bool copy_on_read = m_pending_requests.empty();
     if (!add_copyup_op && copy_on_read) {
-      // no copyup data and CoR operation
-      return true;
+      // copyup empty object to prevent future CoR attempts
+      m_copyup_data.clear();
+      add_copyup_op = true;
     }
 
     ldout(m_ictx->cct, 20) << __func__ << " " << this
@@ -220,10 +221,8 @@ private:
     case STATE_READ_FROM_PARENT:
       ldout(cct, 20) << "READ_FROM_PARENT" << dendl;
       remove_from_list();
-      if (r >= 0) {
+      if (r >= 0 || r == -ENOENT) {
         return send_object_map();
-      } else if (r == -ENOENT) {
-        return send_copyup();
       }
       break;