diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index df32b4dcbd9..66846ce8010 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -18365,11 +18365,12 @@ int BlueStore::_maybe_unshare_on_remove( // Do not account second time. maybe_unshared_blobs.erase(sb); } else { - // todo: it seems to be an overkill to go through map() - b.map(e.blob_offset, e.length, [&](uint64_t off, uint64_t len) { - expect[B].get(off, len); - return 0; - }); + for (const auto& e: b.get_extents()) { + if (e.is_valid()) { + expect[B].get(e.offset, e.length); + } + } + maybe_unshared_blobs.erase(sb); } } }