From: Sage Weil Date: Wed, 11 Oct 2017 21:48:41 +0000 (-0500) Subject: os/bluestore: handle compressed extents in blob unsharing checks X-Git-Tag: v12.2.2~124^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ad21109ed2df068bb113e8551505b850fbfcb30;p=ceph.git 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) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 6e435a5e95df..47eb571b426c 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; + }); + } } }