]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: handle compressed extents in blob unsharing checks 18255/head
authorSage Weil <sage@redhat.com>
Wed, 11 Oct 2017 21:48:41 +0000 (16:48 -0500)
committerSage Weil <sage@redhat.com>
Wed, 11 Oct 2017 21:48:41 +0000 (16:48 -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>
src/os/bluestore/BlueStore.cc

index f519860c7d61d91f6c9a5a78cf424aeef2ae34ff..d2255e018a35951270748e55aa048272d9823b31 100644 (file)
@@ -10684,10 +10684,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;
+         });
+      }
     }
   }