From: Jason Dillaman Date: Wed, 14 Oct 2020 23:46:06 +0000 (-0400) Subject: librbd: fix issue with image-extent based ReadResult handler X-Git-Tag: v17.0.0~784^2~12 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e943ac80ace9bb28136339cb0b13465d2147561f;p=ceph-ci.git librbd: fix issue with image-extent based ReadResult handler The partial result should be based upon buffer-extent positions not the original image-extent positions. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/ReadResult.cc b/src/librbd/io/ReadResult.cc index d0a1e7e8294..21fa29fed5f 100644 --- a/src/librbd/io/ReadResult.cc +++ b/src/librbd/io/ReadResult.cc @@ -152,15 +152,17 @@ void ReadResult::C_ImageReadRequest::finish(int r) { ldout(cct, 10) << "C_ImageReadRequest: r=" << r << dendl; if (r >= 0) { + striper::LightweightBufferExtents buffer_extents; size_t length = 0; for (auto &image_extent : image_extents) { + buffer_extents.emplace_back(length, image_extent.second); length += image_extent.second; } ceph_assert(length == bl.length()); aio_completion->lock.lock(); aio_completion->read_result.m_destriper.add_partial_result( - cct, bl, image_extents); + cct, std::move(bl), buffer_extents); aio_completion->lock.unlock(); r = length; }