From: Jason Dillaman Date: Mon, 2 Mar 2015 13:13:55 +0000 (-0500) Subject: librbd: handle possible aio_read return error code X-Git-Tag: v0.94~65^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1bfd760898dfe97f95333eeef94bb9111dfed4a3;p=ceph.git librbd: handle possible aio_read return error code AioRead and CopyupRequest were not properly handling possible error codes from aio_read. They now correctly free the completion and invoke the callback context. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/AioRequest.cc b/src/librbd/AioRequest.cc index 5b18bdf76261..1e6a28d1c51b 100644 --- a/src/librbd/AioRequest.cc +++ b/src/librbd/AioRequest.cc @@ -68,8 +68,15 @@ namespace librbd { << " parent completion " << m_parent_completion << " extents " << image_extents << dendl; - aio_read(m_ictx->parent, image_extents, NULL, &m_read_data, - m_parent_completion, 0); + int r = aio_read(m_ictx->parent, image_extents, NULL, &m_read_data, + m_parent_completion, 0); + if (r < 0) { + lderr(m_ictx->cct) << "read_from_parent " << this + << ": error reading from parent: " + << cpp_strerror(r) << dendl; + m_parent_completion->release(); + complete(r); + } } static inline bool is_copy_on_read(ImageCtx *ictx, librados::snap_t snap_id) { diff --git a/src/librbd/CopyupRequest.cc b/src/librbd/CopyupRequest.cc index 12f938a52991..687dbe1ce0e1 100644 --- a/src/librbd/CopyupRequest.cc +++ b/src/librbd/CopyupRequest.cc @@ -94,10 +94,11 @@ namespace librbd { int r = aio_read(m_ictx->parent, m_image_extents, NULL, &m_copyup_data, comp, 0); if (r < 0) { + lderr(m_ictx->cct) << __func__ << " " << this + << ": error reading from parent: " + << cpp_strerror(r) << dendl; comp->release(); - - remove_from_list(); - complete_requests(r); + complete(r); } }