From: weiqiaomiao Date: Mon, 31 Oct 2016 05:59:55 +0000 (+0800) Subject: rgw: fix osd crashes when execute "radosgw-admin bi list --max-entries=1" command X-Git-Tag: v10.2.6~30^2~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8de67afed415875394ad0405046ead6206ffa636;p=ceph.git rgw: fix osd crashes when execute "radosgw-admin bi list --max-entries=1" command Fixes: http://tracker.ceph.com/issues/17745 Signed-off-by: weiqiaomiao (cherry picked from commit 51a4405a1ef59671cbd51c530a84333359d3f3dd) Conflicts: src/cls/rgw/cls_rgw.cc trivial resolution --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 46c2a3f9b49f..4754661ca62f 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2388,7 +2388,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, bufferlist *in, bufferlist string filter = op.name; #define MAX_BI_LIST_ENTRIES 1000 - int32_t max = (op.max < MAX_BI_LIST_ENTRIES ? op.max : MAX_BI_LIST_ENTRIES); + int32_t max = (op.max < MAX_BI_LIST_ENTRIES ? op.max : MAX_BI_LIST_ENTRIES) + 1; /* one extra entry for identifying truncation */ string start_key = op.marker; int ret = list_plain_entries(hctx, op.name, op.marker, max, &op_ret.entries); if (ret < 0) {