]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd/io: conditionally disable move optimization 39958/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 4 Feb 2021 16:17:48 +0000 (11:17 -0500)
committerNathan Cutler <ncutler@suse.com>
Tue, 9 Mar 2021 19:59:10 +0000 (20:59 +0100)
If the requested write length does not match the provided bufferlist
length, disable the move optimization and instead fallback to creating
a new sub-bufferlist for the object request.

Fixes: https://tracker.ceph.com/issues/49173
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8dbb4a3d971d9a48c171f161f531956dd0030403)

src/librbd/io/ImageRequest.cc

index 977182eacd1c53426c4bbaa1dd3164d8f8f89f56..004c41c7dd899ec48f4dce8304b18e33d9b09517 100644 (file)
@@ -553,7 +553,8 @@ ObjectDispatchSpec *ImageWriteRequest<I>::create_object_request(
   I &image_ctx = this->m_image_ctx;
 
   bufferlist bl;
-  if (single_extent && object_extent.buffer_extents.size() == 1) {
+  if (single_extent && object_extent.buffer_extents.size() == 1 &&
+      m_bl.length() == object_extent.length) {
     // optimization for single object/buffer extent writes
     bl = std::move(m_bl);
   } else {