]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Make maybe_unshare_extents use allocations
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 2 Jun 2026 05:59:39 +0000 (05:59 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Thu, 9 Jul 2026 09:33:36 +0000 (09:33 +0000)
Blob is tracking whole AUs in SharedBlob tracker.
But the extents may account for just a portion of AUs.
We need to compare what would Blob release against SharedBlob tracker.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index df32b4dcbd92ab4ebd0bdf4b86208cc01c38f8a5..66846ce8010c8b4880092a9bcf9907dbe07d9210 100644 (file)
@@ -18365,11 +18365,12 @@ int BlueStore::_maybe_unshare_on_remove(
         // Do not account second time.
         maybe_unshared_blobs.erase(sb);
       } else {
-       // todo: it seems to be an overkill to go through map()
-       b.map(e.blob_offset, e.length, [&](uint64_t off, uint64_t len) {
-           expect[B].get(off, len);
-           return 0;
-         });
+        for (const auto& e: b.get_extents()) {
+          if (e.is_valid()) {
+            expect[B].get(e.offset, e.length);
+          }
+        }
+        maybe_unshared_blobs.erase(sb);
       }
     }
   }