From 0f4453363f6a873d2d274105da5afaa521cd7784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 25 Aug 2005 23:19:41 +0000 Subject: [PATCH] Ported the two bug fixes from r14063 (in BPlusTree::RemoveDuplicate()) to the R5 version of BFS. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14064 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/add-ons/kernel/file_systems/bfs/r5/BPlusTree.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/BPlusTree.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/BPlusTree.cpp index 0dc90ee9df..0f00eefc5a 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/BPlusTree.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/BPlusTree.cpp @@ -1218,9 +1218,11 @@ BPlusTree::RemoveDuplicate(Transaction *transaction, bplustree_node *node, Cache bplustree_node::FragmentIndex(oldValue), duplicateOffset, array->count)); return B_BAD_DATA; } - if (!array->Remove(value)) + if (!array->Remove(value)) { FATAL(("Oh no, value %Ld not found in fragments of node %Ld...\n", value, duplicateOffset)); + return B_ENTRY_NOT_FOUND; + } // remove the array from the fragment node if it is empty if (array->count == 1) { @@ -1307,6 +1309,7 @@ BPlusTree::RemoveDuplicate(Transaction *transaction, bplustree_node *node, Cache // If the next node is the last node, we need to free that node // and convert the duplicate entry back into a normal entry + array = duplicate->DuplicateArray(); if (right == BPLUSTREE_NULL && duplicate->LeftLink() == BPLUSTREE_NULL && duplicate->DuplicateArray()->count <= NUM_FRAGMENT_VALUES) { duplicateOffset = left;