]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix osd crashes when execute "radosgw-admin bi list --max-entries=1" command 11697/head
authorweiqiaomiao <wei.qiaomiao@zte.com.cn>
Mon, 31 Oct 2016 05:59:55 +0000 (13:59 +0800)
committerweiqiaomiao <wei.qiaomiao@zte.com.cn>
Mon, 31 Oct 2016 05:59:55 +0000 (13:59 +0800)
Fixes: http://tracker.ceph.com/issues/17745
Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
src/cls/rgw/cls_rgw.cc

index 063476754479c15485646ab4ea1dae0bcc56ede4..84aaf57e703c4b1f7c7cff80e32d8c483b1d7b83 100644 (file)
@@ -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;