If a blob is shared, we can't discard deallocated regions: there may
be deferred buffers in flight and we might get a read via the clone.
Signed-off-by: Sage Weil <sage@redhat.com>
void BlueStore::Blob::discard_unallocated(Collection *coll)
{
+ if (blob.is_shared()) {
+ return;
+ }
if (blob.is_compressed()) {
bool discard = false;
bool all_invalid = true;
size_t pos = 0;
for (auto e : blob.extents) {
if (!e.is_valid()) {
+ ldout(coll->store->cct, 20) << __func__ << " 0x" << std::hex << pos
+ << "~" << e.length
+ << std::dec << dendl;
shared_blob->bc.discard(shared_blob->get_cache(), pos, e.length);
}
pos += e.length;