]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: handle compressed extents in blob unsharing checks 18501/head
authorSage Weil <sage@redhat.com>
Wed, 11 Oct 2017 21:48:41 +0000 (16:48 -0500)
committerSage Weil <sage@redhat.com>
Tue, 24 Oct 2017 02:35:30 +0000 (21:35 -0500)
If the blob is compressed, we aren't mapping to a range within
the allocated extents, but rather referencing the entire blob.

Fixes: http://tracker.ceph.com/issues/21766
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit eb26cfbfbb2b9b9fe84dfe9c999e2d67fd2661c0)

src/os/bluestore/BlueStore.cc

index 6e435a5e95df96106731f26f90317910cab89d97..47eb571b426ca2680eeadaa129b091439019e818 100644 (file)
@@ -10691,10 +10691,14 @@ int BlueStore::_do_remove(
     if (b.is_shared() &&
        sb->loaded &&
        maybe_unshared_blobs.count(sb)) {
-      b.map(e.blob_offset, e.length, [&](uint64_t off, uint64_t len) {
-        expect[sb].get(off, len);
-       return 0;
-      });
+      if (b.is_compressed()) {
+       expect[sb].get(0, b.get_ondisk_length());
+      } else {
+       b.map(e.blob_offset, e.length, [&](uint64_t off, uint64_t len) {
+           expect[sb].get(off, len);
+           return 0;
+         });
+      }
     }
   }