]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix the problem of duplicate idx when bi list 49828/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:19:30 +0000 (16:19 -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 d0046e87dc1f868618e1823afb69db07dd9a5d1f..8a660a8868115fd6ca238b6766c1d4bc6dd71426 100644 (file)
@@ -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;
   }