]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix bucket index list minor calculation bug 44562/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 12 Jan 2022 18:41:42 +0000 (13:41 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Wed, 12 Jan 2022 19:02:15 +0000 (14:02 -0500)
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 <skoduri@redhat.com>.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/cls/rgw/cls_rgw.cc

index 31cef6d0679108c774491aa005f0763e7dbe7442..432b3aef71a41ff889f33f2eb000a4903e42846f 100644 (file)
@@ -2984,7 +2984,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",