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: v15.1.1~100^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f63bf47aa464c345c907c748dfdbbc5a239d8488;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 --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 3b83ffc8b1c..89faeaaa6b2 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -4476,12 +4476,12 @@ int RGWRados::transition_obj(RGWObjectCtx& obj_ctx, int RGWRados::check_bucket_empty(RGWBucketInfo& bucket_info, optional_yield y) { - 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,