From 7473dbe91752a0d943eb582356dbcb3e15f946b7 Mon Sep 17 00:00:00 2001 From: wangtengfei Date: Thu, 8 Dec 2022 09:07:19 +0800 Subject: [PATCH] rgw: fix the problem of duplicate idx when bi list fix: https://tracker.ceph.com/issues/58213 Signed-off-by: wangtengfei --- src/cls/rgw/cls_rgw.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 25fe3b27576ab..a4c531915514f 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; } -- 2.39.5