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: v18.1.0~486^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F49315%2Fhead;p=ceph.git rgw: fix the problem of duplicate idx when bi list fix: https://tracker.ceph.com/issues/58213 Signed-off-by: wangtengfei --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 25fe3b27576a..a4c531915514 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2964,7 +2964,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; } @@ -3054,7 +3056,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; }