Skip to content

Commit b246233

Browse files
cbodleymattbenjamin
authored andcommitted
rgw: GetObjAttrs enforces MaxSize and returns correct IsTruncated
Signed-off-by: Casey Bodley <[email protected]>
1 parent f6bc276 commit b246233

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/rgw/driver/rados/rgw_sal_rados.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,6 +2527,11 @@ int RadosObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct,
25272527
continue;
25282528
}
25292529

2530+
if (max_parts < 1) {
2531+
*truncated = true;
2532+
break;
2533+
}
2534+
25302535
/* get_part_obj_state alters the passed manifest** to point to a part
25312536
* manifest, which we don't want to leak out here */
25322537
RGWObjManifest* obj_m = manifest;
@@ -2563,6 +2568,7 @@ int RadosObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct,
25632568

25642569
each_func(obj_part);
25652570
*next_marker = ++marker;
2571+
--max_parts;
25662572
} /* each part */
25672573

25682574
return ret;

src/rgw/rgw_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ class RGWGetObjAttrs : public RGWGetObj {
16511651
std::string version_id;
16521652
std::string expected_bucket_owner;
16531653
int marker{0};
1654-
int max_parts{0};
1654+
int max_parts{1000};
16551655
uint16_t requested_attributes{0};
16561656
#if 0
16571657
/* used to decrypt attributes for objects stored with SSE-C */

0 commit comments

Comments
 (0)