Skip to content

Commit 84f1e6f

Browse files
committed
return parts_count from read_op::prepare whenever applicable
* fix to deal with parts_count == 1 asymmetry Signed-off-by: Matt Benjamin <[email protected]>
1 parent d3ff9c6 commit 84f1e6f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6747,6 +6747,12 @@ int RGWRados::Object::Read::prepare(optional_yield y, const DoutPrefixProvider *
67476747
if (r < 0)
67486748
return r;
67496749

6750+
if (manifest /* params.parts_count */) {
6751+
RGWObjManifest::obj_iterator end = manifest->obj_end(dpp);
6752+
auto cur_part_id = end.get_cur_part_id();
6753+
params.parts_count = (cur_part_id == 1) ? 1 : cur_part_id - 1;;
6754+
}
6755+
67506756
if (!astate->exists) {
67516757
return -ENOENT;
67526758
}

0 commit comments

Comments
 (0)