From 170cce73aff77ea8a7ac1ab20ee5bf3a019357a8 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 12 Jan 2022 13:41:42 -0500 Subject: [PATCH] rgw: fix bucket index list minor calculation bug When "bucket index list" traverses the different regions in the bucket index assembling the output, it miscalculates how many entries to ask for at one point. This fixes that. This fixes previous "rgw: bucket index list can produce I/O errors". Credit for finding this bug goes to Soumya Koduri . Signed-off-by: J. Eric Ivancich (cherry picked from commit aa7605151f0a5f467d50f13f27c7aef42a40cc39) --- 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 10bc040ad68d..325bb3809319 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2909,7 +2909,7 @@ static int rgw_bi_list_op(cls_method_context_t hctx, } if (!more) { - ret = list_plain_entries(hctx, op.name_filter, op.marker, max, + ret = list_plain_entries(hctx, op.name_filter, op.marker, max - count, &op_ret.entries, &more, PlainEntriesRegion::High); if (ret < 0) { CLS_LOG(0, "ERROR: %s: list_plain_entries (high) returned ret=%d, marker=\"%s\", filter=\"%s\", max=%d", -- 2.47.3