From 3ad21109ed2df068bb113e8551505b850fbfcb30 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 11 Oct 2017 16:48:41 -0500 Subject: [PATCH] os/bluestore: handle compressed extents in blob unsharing checks 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 (cherry picked from commit eb26cfbfbb2b9b9fe84dfe9c999e2d67fd2661c0) --- src/os/bluestore/BlueStore.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 6e435a5e95df9..47eb571b426ca 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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; + }); + } } } -- 2.39.5