From: Radosław Zarzyński Date: Tue, 7 Nov 2023 16:30:51 +0000 (+0100) Subject: osd: attrs are obligatory param for ECBackend::get_hash_info() X-Git-Tag: testing/wip-batrick-testing-20240411.154038~431^2~12 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4917790bea02f00762c32f9865103e918be01971;p=ceph-ci.git osd: attrs are obligatory param for ECBackend::get_hash_info() Signed-off-by: Radosław Zarzyński (cherry picked from commit 149c61c180fadeae7fe5a1574aa8eba01bc0550b) --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 836bf96dde4..686e179f987 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -518,7 +518,7 @@ void ECBackend::continue_recovery_op( if (op.recovery_progress.first && op.obc) { /* We've got the attrs and the hinfo, might as well use them */ - op.hinfo = get_hash_info(op.hoid, false, &op.obc->attr_cache); + op.hinfo = get_hash_info(op.hoid, false, op.obc->attr_cache); if (!op.hinfo) { derr << __func__ << ": " << op.hoid << " has inconsistent hinfo" << dendl; @@ -1015,7 +1015,7 @@ void ECBackend::handle_sub_read( map> attrs; int r = PGBackend::objects_get_attrs(i->first, &attrs); if (r >= 0) { - hinfo = get_hash_info(i->first, false, &attrs); + hinfo = get_hash_info(i->first, false, attrs); } else { derr << "get_hash_info" << ": stat " << i->first << " failed: " << cpp_strerror(r) << dendl; @@ -1377,7 +1377,7 @@ void ECBackend::submit_transaction( sinfo, *(op->t), [&](const hobject_t &i) { - ECUtil::HashInfoRef ref = get_hash_info(i, true, &op->t->obc_map[hoid]->attr_cache); + ECUtil::HashInfoRef ref = get_hash_info(i, true, op->t->obc_map[hoid]->attr_cache); if (!ref) { derr << __func__ << ": get_hash_info(" << i << ")" << " returned a null pointer and there is no " @@ -1394,7 +1394,7 @@ void ECBackend::submit_transaction( ECUtil::HashInfoRef ECBackend::get_hash_info( - const hobject_t &hoid, bool create, const map> *attrs) + const hobject_t &hoid, bool create, const map>& attrs) { dout(10) << __func__ << ": Getting attr on " << hoid << dendl; ECUtil::HashInfoRef ref = unstable_hashinfo_registry.lookup(hoid); @@ -1409,9 +1409,8 @@ ECUtil::HashInfoRef ECBackend::get_hash_info( if (r >= 0) { dout(10) << __func__ << ": found on disk, size " << st.st_size << dendl; bufferlist bl; - ceph_assert(attrs); - map::const_iterator k = attrs->find(ECUtil::get_hinfo_key()); - if (k == attrs->end()) { + map::const_iterator k = attrs.find(ECUtil::get_hinfo_key()); + if (k == attrs.end()) { dout(5) << __func__ << " " << hoid << " missing hinfo attr" << dendl; } else { bl = k->second; @@ -1677,7 +1676,7 @@ int ECBackend::be_deep_scrub( return -EINPROGRESS; } - ECUtil::HashInfoRef hinfo = get_hash_info(poid, false, &o.attrs); + ECUtil::HashInfoRef hinfo = get_hash_info(poid, false, o.attrs); if (!hinfo) { dout(0) << "_scan_list " << poid << " could not retrieve hash info" << dendl; o.read_error = true; diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 27176bf18f9..a134ea58e69 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -326,7 +326,7 @@ public: /// If modified, ensure that the ref is held until the update is applied SharedPtrRegistry unstable_hashinfo_registry; ECUtil::HashInfoRef get_hash_info(const hobject_t &hoid, bool create, - const std::map> *attr); + const std::map>& attr); public: ECBackend(