diff --git a/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp b/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp index 895666f8df..badbf11031 100644 --- a/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp +++ b/src/add-ons/kernel/file_systems/bfs/BPlusTree.cpp @@ -826,7 +826,7 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached, bplustree_node *newDuplicate; status = cachedDuplicate.Allocate(transaction, &newDuplicate, &offset); if (status < B_OK) - return status; + RETURN_ERROR(status); // copy the array from the fragment node to the duplicate node // and free the old entry (by zero'ing all values) @@ -884,7 +884,7 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached, bplustree_node *newDuplicate; status = cachedDuplicate.Allocate(transaction, &newDuplicate, &offset); if (status < B_OK) - return status; + RETURN_ERROR(status); // link the two nodes together writableDuplicate->right_link = HOST_ENDIAN_TO_BFS_INT64(offset); @@ -906,7 +906,7 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached, &offset, &fragment, &fragmentIndex) != B_OK) { // allocate a new duplicate fragment node if ((status = cachedDuplicate.Allocate(transaction, &fragment, &offset)) < B_OK) - return status; + RETURN_ERROR(status); memset(fragment, 0, fNodeSize); } @@ -1233,9 +1233,13 @@ BPlusTree::Insert(Transaction &transaction, const uint8 *key, uint16 keyLength, // is this a duplicate entry? if (status == B_OK) { - if (fAllowDuplicates) - return InsertDuplicate(transaction, cached, node, nodeAndKey.keyIndex, value); - + if (fAllowDuplicates) { + status = InsertDuplicate(transaction, cached, node, nodeAndKey.keyIndex, value); + if (status != B_OK) + RETURN_ERROR(status); + return B_OK; + } + RETURN_ERROR(B_NAME_IN_USE); } } diff --git a/src/add-ons/kernel/file_systems/bfs/Index.cpp b/src/add-ons/kernel/file_systems/bfs/Index.cpp index 3831540ff0..65320b0ecc 100644 --- a/src/add-ons/kernel/file_systems/bfs/Index.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Index.cpp @@ -255,7 +255,7 @@ Index::Update(Transaction &transaction, const char *name, int32 type, const uint BPlusTree *tree; if ((status = Node()->GetTree(&tree)) < B_OK) - return status; + status; // remove the old key from the tree @@ -265,7 +265,7 @@ Index::Update(Transaction &transaction, const char *name, int32 type, const uint // That's not nice, but should be no reason to let the whole thing fail INFORM(("Could not find value in index \"%s\"!\n", name)); } else if (status < B_OK) - return status; + status; } // add the new key to the tree @@ -273,7 +273,7 @@ Index::Update(Transaction &transaction, const char *name, int32 type, const uint if (newKey != NULL) status = tree->Insert(transaction, (const uint8 *)newKey, newLength, inode->ID()); - return status; + RETURN_ERROR(status); } diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index 8a0784696b..75c37f5f5e 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -2258,7 +2258,7 @@ Inode::Create(Transaction &transaction, Inode *parent, const char *name, int32 m else if (parent != NULL && (mode & S_ATTR_DIR) != 0) parent->Node().attributes.SetTo(0, 0, 0); - return status; + RETURN_ERROR(status); } }