goto fail;
}
pg_t raw_pg;
- get_osdmap()->object_locator_to_pg(target_name, target_oloc, raw_pg);
+ result = get_osdmap()->object_locator_to_pg(target_name, target_oloc, raw_pg);
+ if (result < 0) {
+ dout(5) << " pool information is invalid: " << result << dendl;
+ break;
+ }
hobject_t target(target_name, target_oloc.key, target_snapid,
raw_pg.ps(), raw_pg.pool(),
target_oloc.nspace);
pg_t raw_pg;
chunk_info_t chunk_info;
- get_osdmap()->object_locator_to_pg(tgt_name, tgt_oloc, raw_pg);
+ result = get_osdmap()->object_locator_to_pg(tgt_name, tgt_oloc, raw_pg);
+ if (result < 0) {
+ dout(5) << " pool information is invalid: " << result << dendl;
+ break;
+ }
hobject_t target(tgt_name, tgt_oloc.key, snapid_t(),
raw_pg.ps(), raw_pg.pool(),
tgt_oloc.nspace);
for (auto p : cdc_chunks) {
bufferlist chunk;
chunk.substr_of(bl, p.first, p.second);
- hobject_t target = get_fpoid_from_chunk(oi.soid, chunk);
+ auto [ret, target] = get_fpoid_from_chunk(oi.soid, chunk);
+ if (ret < 0) {
+ return ret;
+ }
chunks[p.first] = std::move(chunk);
chunk_map[p.first] = chunk_info_t(0, p.second, target);
total_length += p.second;
return total_length;
}
-hobject_t PrimaryLogPG::get_fpoid_from_chunk(const hobject_t soid, bufferlist& chunk)
+std::pair<int, hobject_t> PrimaryLogPG::get_fpoid_from_chunk(
+ const hobject_t soid, bufferlist& chunk)
{
pg_pool_t::fingerprint_t fp_algo = pool.info.get_fingerprint_type();
if (fp_algo == pg_pool_t::TYPE_FINGERPRINT_NONE) {
- return hobject_t();
+ return make_pair(-EINVAL, hobject_t());
}
object_t fp_oid = [&fp_algo, &chunk]() -> string {
switch (fp_algo) {
oloc.pool = pool.info.get_dedup_tier();
// check if dedup_tier isn't set
ceph_assert(oloc.pool > 0);
- get_osdmap()->object_locator_to_pg(fp_oid, oloc, raw_pg);
+ int ret = get_osdmap()->object_locator_to_pg(fp_oid, oloc, raw_pg);
+ if (ret < 0) {
+ return make_pair(ret, hobject_t());
+ }
hobject_t target(fp_oid, oloc.key, snapid_t(),
raw_pg.ps(), raw_pg.pool(),
oloc.nspace);
- return target;
+ return make_pair(0, target);
}
int PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64_t offset)