crimson: fix object not exist when do fiemap

Signed-off-by: chunmei-liu <chunmei.liu@intel.com>
This commit is contained in:
chunmei-liu 2022-02-24 21:48:07 -08:00
parent 2bc57d3fc3
commit 50bd0c7641
2 changed files with 13 additions and 3 deletions

View File

@ -586,9 +586,14 @@ AlienStore::read_errorator::future<std::map<uint64_t, uint64_t>> AlienStore::fie
return tp->submit(ch->get_cid().hash_to_shard(tp->size()), [=, &destmap] {
auto c = static_cast<AlienCollection*>(ch.get());
return store->fiemap(c->collection, oid, off, len, destmap);
}).then([&destmap](int i) {
return read_errorator::make_ready_future<std::map<uint64_t, uint64_t>>(
std::move(destmap));
}).then([&destmap](int r)
-> read_errorator::future<std::map<uint64_t, uint64_t>> {
if (r == -ENOENT) {
return crimson::ct_error::enoent::make();
} else {
return read_errorator::make_ready_future<std::map<uint64_t, uint64_t>>(
std::move(destmap));
}
});
});
}

View File

@ -231,6 +231,11 @@ PGBackend::read_ierrorator::future<>
PGBackend::sparse_read(const ObjectState& os, OSDOp& osd_op,
object_stat_sum_t& delta_stats)
{
if (!os.exists || os.oi.is_whiteout()) {
logger().debug("{}: {} DNE", __func__, os.oi.soid);
return crimson::ct_error::enoent::make();
}
const auto& op = osd_op.op;
logger().trace("sparse_read: {} {}~{}",
os.oi.soid, op.extent.offset, op.extent.length);