From: Jason Dillaman Date: Thu, 21 May 2015 20:25:37 +0000 (-0400) Subject: librbd: CoR should copyup empty object to prevent future CoR attempts X-Git-Tag: v9.0.2~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4730%2Fhead;p=ceph.git librbd: CoR should copyup empty object to prevent future CoR attempts Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/CopyupRequest.cc b/src/librbd/CopyupRequest.cc index e8b6130f897d..2580af1f42a5 100644 --- a/src/librbd/CopyupRequest.cc +++ b/src/librbd/CopyupRequest.cc @@ -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;