From: wangtengfei Date: Thu, 8 Dec 2022 01:07:19 +0000 (+0800) Subject: rgw: fix the problem of duplicate idx when bi list X-Git-Tag: v16.2.13~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65243ebdee9c4c231872a4c98639775e0e307a39;p=ceph.git rgw: fix the problem of duplicate idx when bi list fix: https://tracker.ceph.com/issues/58213 Signed-off-by: wangtengfei (cherry picked from commit 7473dbe91752a0d943eb582356dbcb3e15f946b7) --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 61585ce64d2..0cf2fab0c0b 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2755,7 +2755,9 @@ static int list_instance_entries(cls_method_context_t hctx, if (ret < 0 && ret != -ENOENT) { return ret; } - bool found_first = (ret == 0); + // we need to include the exact match if a filter (name) is + // specified and the marker has not yet advanced (i.e., been set) + bool found_first = (ret == 0) && (start_after_key != marker); if (found_first) { --max; } @@ -2845,7 +2847,9 @@ static int list_olh_entries(cls_method_context_t hctx, if (ret < 0 && ret != -ENOENT) { return ret; } - bool found_first = (ret == 0); + // we need to include the exact match if a filter (name) is + // specified and the marker has not yet advanced (i.e., been set) + bool found_first = (ret == 0) && (start_after_key != marker); if (found_first) { --max; }