]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix issue with image-extent based ReadResult handler
authorJason Dillaman <dillaman@redhat.com>
Wed, 14 Oct 2020 23:46:06 +0000 (19:46 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 21 Oct 2020 16:25:03 +0000 (12:25 -0400)
The partial result should be based upon buffer-extent positions
not the original image-extent positions.

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

index d0a1e7e8294a311958569070f7199126f3fdaffc..21fa29fed5fc70d8daa44aa6770641307daad081 100644 (file)
@@ -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;
   }