Skip to content

Commit

Permalink
Merge pull request ceph#11697 from weiqiaomiao/wqm-wip-rgw-bilist
Browse files Browse the repository at this point in the history
rgw: fix osd crashes when execute "radosgw-admin bi list --max-entries=1" command

Reviewed-by: Yehuda Sadeh <[email protected]>
  • Loading branch information
yehudasa authored Nov 1, 2016
2 parents 352078d + 51a4405 commit f890a71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cls/rgw/cls_rgw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2516,9 +2516,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 f890a71

Please sign in to comment.