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: v17.2.6~114^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61e6a9243db39a22287d7dbfab9079b806ebaf54;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 d0046e87dc1f..8a660a886811 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2762,7 +2762,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; } @@ -2852,7 +2854,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; }