From: Orit Wasserman Date: Fri, 28 Apr 2017 10:13:07 +0000 (+0300) Subject: rgw: limit op.max and add extra entry to handle tuncation in cls_rgw_reshard_list X-Git-Tag: v12.1.0~276^2~73 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae6a5eac37a10c8e058764a28d85fc44bc0b29df;p=ceph-ci.git rgw: limit op.max and add extra entry to handle tuncation in cls_rgw_reshard_list Signed-off-by: Orit Wasserman --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 03f8764aa91..ca002064dd1 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -3519,7 +3519,10 @@ static int rgw_reshard_list(cls_method_context_t hctx, bufferlist *in, bufferlis bufferlist::iterator iter; map vals; string filter_prefix; - int ret = cls_cxx_map_get_vals(hctx, op.marker, filter_prefix, op.max, &vals); + #define MAX_RESHARD_LIST_ENTRIES 1000 + /* one extra entry for identifying truncation */ + int32_t max = (op.max < MAX_RESHARD_LIST_ENTRIES ? op.max : MAX_RESHARD_LIST_ENTRIES) + 1; + int ret = cls_cxx_map_get_vals(hctx, op.marker, filter_prefix, max, &vals); if (ret < 0) return ret; map::iterator it;