Skip to content

Commit

Permalink
rgw: fix osd crashes when execute "radosgw-admin bi list --max-entrie…
Browse files Browse the repository at this point in the history
…s=1" command

Fixes: http://tracker.ceph.com/issues/17745
Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
(cherry picked from commit 51a4405)
  • Loading branch information
weiqiaomiao authored and oritwas committed Jan 2, 2017
1 parent 530d1e2 commit ac62d79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cls/rgw/cls_rgw.cc
Expand Up @@ -2375,9 +2375,9 @@ 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) + 1; /* one extra entry for identifying truncation */
int ret = list_plain_entries(hctx, op.name, op.marker, max, &op_ret.entries);
if (ret < 0) {
CLS_LOG(0, "ERROR: %s(): list_plain_entries retured ret=%d", __func__, ret);
return ret;
Expand Down

0 comments on commit ac62d79

Please sign in to comment.