Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-17148 common: btree delete may move target out of boundary - b26 #15949

Draft
wants to merge 1 commit into
base: release/2.6
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/common/btree.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2016-2024 Intel Corporation.
* (C) Copyright 2025 Hewlett Packard Enterprise Development LP
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -3152,12 +3153,13 @@ btr_node_del_rec(struct btr_context *tcx, struct btr_trace *par_tr,
D_DEBUG(DB_TRACE, "Parent trace at=%d, key_nr=%d\n",
par_tr->tr_at, par_nd->tn_keyn);

D_ASSERT(par_tr->tr_at < par_nd->tn_keyn);

if (par_tr->tr_at == 0) {
/* only has sibling on the right side */
sib_off = btr_node_child_at(tcx, par_tr->tr_node, 1);
sib_on_right = true;

} else if (par_tr->tr_at == par_nd->tn_keyn) {
} else if (par_tr->tr_at == par_nd->tn_keyn - 1) {
/* only has sibling on the left side */
sib_off = btr_node_child_at(tcx, par_tr->tr_node,
par_tr->tr_at - 1);
Expand Down