]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix osd crashes when execute "radosgw-admin bi list --max-entries=1" command 11758/head
authorweiqiaomiao <wei.qiaomiao@zte.com.cn>
Mon, 31 Oct 2016 05:59:55 +0000 (13:59 +0800)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Thu, 3 Nov 2016 08:55:24 +0000 (14:25 +0530)
Fixes: http://tracker.ceph.com/issues/17745
Signed-off-by: weiqiaomiao <wei.qiaomiao@zte.com.cn>
(cherry picked from commit 51a4405a1ef59671cbd51c530a84333359d3f3dd)

Conflicts:
src/cls/rgw/cls_rgw.cc
trivial resolution

src/cls/rgw/cls_rgw.cc

index 46c2a3f9b49fc60b0dd08a33f79837128b4bcbe1..4754661ca62f2142af9362caea3649356730cbdf 100644 (file)
@@ -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) {