]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix the problem of duplicate idx when bi list 49315/head
authorwangtengfei <wangtengfei@inspur.com>
Thu, 8 Dec 2022 01:07:19 +0000 (09:07 +0800)
committerwangtengfei <wangtengfei@inspur.com>
Fri, 20 Jan 2023 01:28:15 +0000 (09:28 +0800)
fix: https://tracker.ceph.com/issues/58213

Signed-off-by: wangtengfei <wangtengfei@inspur.com>
src/cls/rgw/cls_rgw.cc

index 25fe3b27576abc2b7dbe05bbc23e88360af1af70..a4c531915514f11d62a3c6b30d807c405db04a9a 100644 (file)
@@ -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;
   }