From: Matt Benjamin Date: Sat, 27 Apr 2024 14:24:25 +0000 (-0400) Subject: return parts_count from read_op::prepare whenever applicable X-Git-Tag: testing/wip-vshankar-testing-20240704.104311-debug~8^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=84f1e6ff3577e10f86cede6fa226759ec091d5d2;p=ceph-ci.git return parts_count from read_op::prepare whenever applicable * fix to deal with parts_count == 1 asymmetry Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 088435d8573..f394a3e6ec0 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -6747,6 +6747,12 @@ int RGWRados::Object::Read::prepare(optional_yield y, const DoutPrefixProvider * if (r < 0) return r; + if (manifest /* params.parts_count */) { + RGWObjManifest::obj_iterator end = manifest->obj_end(dpp); + auto cur_part_id = end.get_cur_part_id(); + params.parts_count = (cur_part_id == 1) ? 1 : cur_part_id - 1;; + } + if (!astate->exists) { return -ENOENT; }