]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: enforce blob's tail prunning after splitting.
authorIgor Fedotov <igor.fedotov@croit.io>
Fri, 8 May 2026 12:13:04 +0000 (15:13 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Tue, 12 May 2026 14:55:21 +0000 (17:55 +0300)
Failing to do that could cause "left" blob to keep having invalid
pextents at the end. Which we prefer to avoid.

Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit b9b25eacceac3463266d1339656b1ef1f156d858)

src/os/bluestore/BlueStore.cc

index 9a93f65f0b41957709a8a59cdff73e5b7303c205..c09d05a1c9911673962adae2a48c177c755c96fc 100644 (file)
@@ -2919,6 +2919,7 @@ void BlueStore::Blob::split(Collection *coll, uint32_t blob_offset, Blob *r)
 {
   dout(10) << __func__ << " 0x" << std::hex << blob_offset << std::dec
           << " start " << *this << dendl;
+  ceph_assert(r);
   ceph_assert(blob.can_split());
   ceph_assert(used_in_blob.can_split());
   bluestore_blob_t &lb = dirty_blob();
@@ -2930,6 +2931,10 @@ void BlueStore::Blob::split(Collection *coll, uint32_t blob_offset, Blob *r)
 
   lb.split(blob_offset, rb);
 
+  maybe_prune_tail(); // we might get tail-to-prune after splitting
+  r->maybe_prune_tail(); // likely redundant (as we tend to prune original blob beforehand)
+                         // but let it be
+
   dout(10) << __func__ << " 0x" << std::hex << blob_offset << std::dec
           << " finish " << *this << dendl;
   dout(10) << __func__ << " 0x" << std::hex << blob_offset << std::dec