From: Casey Bodley Date: Fri, 18 Oct 2024 17:46:38 +0000 (-0400) Subject: rgw: GetObjAttrs enforces MaxSize and returns correct IsTruncated X-Git-Tag: v20.0.0~421^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2462337c4096427611f724874e5b24bff79a5d4;p=ceph.git rgw: GetObjAttrs enforces MaxSize and returns correct IsTruncated Signed-off-by: Casey Bodley --- diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index 49ad4bb3bb21..24f44c94f379 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -2527,6 +2527,11 @@ int RadosObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct, continue; } + if (max_parts < 1) { + *truncated = true; + break; + } + /* get_part_obj_state alters the passed manifest** to point to a part * manifest, which we don't want to leak out here */ RGWObjManifest* obj_m = manifest; @@ -2563,6 +2568,7 @@ int RadosObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct, each_func(obj_part); *next_marker = ++marker; + --max_parts; } /* each part */ return ret; diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index dfc2b914b5b5..d3980bc71831 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -1651,7 +1651,7 @@ protected: std::string version_id; std::string expected_bucket_owner; int marker{0}; - int max_parts{0}; + int max_parts{1000}; uint16_t requested_attributes{0}; #if 0 /* used to decrypt attributes for objects stored with SSE-C */