From: Xuehan Xu Date: Mon, 22 Aug 2022 06:51:12 +0000 (+0800) Subject: crimson/os/seastore/async_cleaner: fill the semantic gap between backref get_mappings... X-Git-Tag: v18.0.0~175^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4d7897fc6e192cdd89aab57cb0119f9174a3c54;p=ceph.git crimson/os/seastore/async_cleaner: fill the semantic gap between backref get_mappings and space reclaim Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/async_cleaner.cc b/src/crimson/os/seastore/async_cleaner.cc index e92f2d2092f9..3d25f054e3b1 100644 --- a/src/crimson/os/seastore/async_cleaner.cc +++ b/src/crimson/os/seastore/async_cleaner.cc @@ -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,