From 8de67afed415875394ad0405046ead6206ffa636 Mon Sep 17 00:00:00 2001 From: weiqiaomiao Date: Mon, 31 Oct 2016 13:59:55 +0800 Subject: [PATCH] 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 --- src/cls/rgw/cls_rgw.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- 2.47.3