bfs: Fixed removing a listener that was never added.

* When the tree constructor failed, the InodeAllocator would try to remove
  the tree from the transaction. However, in that case, it was never added
  to it.
* Inode::fTree is no longer set if the tree constructor failed.
* This fixes bug #10089.
This commit is contained in:
Axel Dörfler
2013-10-14 23:21:47 +02:00
parent 45a5246706
commit aeee1f7ec7
+10 -3
View File
@@ -236,11 +236,18 @@ InodeAllocator::CreateTree()
if ((fInode->Mode() & S_INDEX_TYPES) == 0)
fInode->Node().mode |= HOST_ENDIAN_TO_BFS_INT32(S_STR_INDEX);
BPlusTree* tree = fInode->fTree
= new(std::nothrow) BPlusTree(*fTransaction, fInode);
if (tree == NULL || tree->InitCheck() < B_OK)
BPlusTree* tree = new(std::nothrow) BPlusTree(*fTransaction, fInode);
if (tree == NULL)
return B_ERROR;
status_t status = tree->InitCheck();
if (status != B_OK) {
delete tree;
return status;
}
fInode->fTree = tree;
if (fInode->IsRegularNode()) {
if (tree->Insert(*fTransaction, ".", fInode->ID()) < B_OK
|| tree->Insert(*fTransaction, "..",