]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix the problem of duplicate idx when bi list 49829/head
authorwangtengfei <wangtengfei@inspur.com>
Thu, 8 Dec 2022 01:07:19 +0000 (09:07 +0800)
committerJ. Eric Ivancich <ivancich@redhat.com>
Sun, 22 Jan 2023 21:23:14 +0000 (16:23 -0500)
fix: https://tracker.ceph.com/issues/58213

Signed-off-by: wangtengfei <wangtengfei@inspur.com>
(cherry picked from commit 7473dbe91752a0d943eb582356dbcb3e15f946b7)

src/cls/rgw/cls_rgw.cc

index 61585ce64d238657403b2495c9a1434cbe45903a..0cf2fab0c0b763d4820d215a7b57d65608bdf890 100644 (file)
@@ -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;
   }