mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
crimson/os/seastore/.../lba_btree_node_impl: fix find_hole
find_hole shouldn't check entries prior to min. Signed-off-by: Samuel Just <sjust@redhat.com>
This commit is contained in:
parent
05c62821d9
commit
5539b54547
@ -145,9 +145,9 @@ LBAInternalNode::find_hole_ret LBAInternalNode::find_hole(
|
||||
bounds.first,
|
||||
bounds.second,
|
||||
L_ADDR_NULL,
|
||||
[this, c, len](auto &i, auto &e, auto &ret) {
|
||||
[=](auto &i, auto &e, auto &ret) {
|
||||
return crimson::do_until(
|
||||
[this, c, &i, &e, &ret, len] {
|
||||
[=, &i, &e, &ret] {
|
||||
if (i == e) {
|
||||
return find_hole_ertr::make_ready_future<std::optional<laddr_t>>(
|
||||
std::make_optional<laddr_t>(L_ADDR_NULL));
|
||||
@ -157,16 +157,18 @@ LBAInternalNode::find_hole_ret LBAInternalNode::find_hole(
|
||||
get_meta().depth - 1,
|
||||
i->get_val(),
|
||||
get_paddr()
|
||||
).safe_then([c, &i, len](auto extent) mutable {
|
||||
).safe_then([=, &i](auto extent) mutable {
|
||||
auto lb = std::max(min, i->get_key());
|
||||
auto ub = i->get_next_key_or_max();
|
||||
logger().debug(
|
||||
"LBAInternalNode::find_hole extent {} lb {} ub {}",
|
||||
*extent,
|
||||
i->get_key(),
|
||||
i->get_next_key_or_max());
|
||||
lb,
|
||||
ub);
|
||||
return extent->find_hole(
|
||||
c,
|
||||
i->get_key(),
|
||||
i->get_next_key_or_max(),
|
||||
lb,
|
||||
ub,
|
||||
len);
|
||||
}).safe_then([&i, &ret](auto addr) mutable {
|
||||
i++;
|
||||
@ -430,7 +432,8 @@ LBALeafNode::find_hole_ret LBALeafNode::find_hole(
|
||||
logger().debug(
|
||||
"LBALeafNode::find_hole min={} max={}, len={}, *this={}",
|
||||
min, max, len, *this);
|
||||
for (auto i = begin(); i != end(); ++i) {
|
||||
auto [liter, uiter] = bound(min, max);
|
||||
for (auto i = liter; i != uiter; ++i) {
|
||||
auto ub = i->get_key();
|
||||
if (min + len <= ub) {
|
||||
return find_hole_ret(
|
||||
|
Loading…
Reference in New Issue
Block a user