]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/async_cleaner: fill the semantic gap between backref get_mappings... 47705/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Mon, 22 Aug 2022 06:51:12 +0000 (14:51 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Wed, 24 Aug 2022 02:26:25 +0000 (10:26 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/async_cleaner.cc

index e92f2d2092f9e1782d59089b391f2f4dc60a06a1..3d25f054e3b111bf813ab261f87e1c0b35ab77a9 100644 (file)
@@ -985,6 +985,16 @@ AsyncCleaner::gc_reclaim_space_ret AsyncCleaner::gc_reclaim_space()
       reclaim_state->start_pos,
       reclaim_state->end_pos
     ).si_then([this, &t](auto pin_list) {
+      if (!pin_list.empty()) {
+       auto it = pin_list.begin();
+       auto &first_pin = *it;
+       if (first_pin->get_key() < reclaim_state->start_pos) {
+         // BackrefManager::get_mappings may include a entry before
+         // reclaim_state->start_pos, which is semantically inconsistent
+         // with the requirements of the cleaner
+         pin_list.erase(it);
+       }
+      }
       return backref_manager.retrieve_backref_extents_in_range(
         t,
         reclaim_state->start_pos,