From: Yao Zongyou Date: Tue, 3 Mar 2020 15:34:26 +0000 (+0000) Subject: rgw: clear ent_list for each loop of bucket list X-Git-Tag: v14.2.10~154^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34099%2Fhead;p=ceph.git rgw: clear ent_list for each loop of bucket list if ent_list is not cleared, the old element will be checked repeatedly and will occupy more memory. Fixes: http://tracker.ceph.com/issues/44394 Signed-off-by: Yao Zongyou (cherry picked from commit f63bf47aa464c345c907c748dfdbbc5a239d8488) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3ca96d8e7b5d..427dfbeb0c7a 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4981,12 +4981,12 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, int RGWRados::check_bucket_empty(RGWBucketInfo& bucket_info) { - std::vector ent_list; rgw_obj_index_key marker; string prefix; bool is_truncated; do { + std::vector ent_list; constexpr uint NUM_ENTRIES = 1000u; int r = cls_bucket_list_unordered(bucket_info, RGW_NO_SHARD,