We must not check the node here.
* The node might not be a normal tree node, so we must not check it before writing. * Also, it's always a good idea to check if the function you called didn't succeed. * This fixes a crashing bug when running checkfs in some rare circumstances.
This commit is contained in:
@@ -776,7 +776,10 @@ BPlusTree::MakeEmpty()
|
|||||||
= HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
= HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bplustree_node* node = cached.SetToWritable(transaction, NodeSize());
|
bplustree_node* node = cached.SetToWritable(transaction, NodeSize(), false);
|
||||||
|
if (node == NULL)
|
||||||
|
return B_IO_ERROR;
|
||||||
|
|
||||||
node->left_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
node->left_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
||||||
node->right_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
node->right_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
||||||
node->overflow_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
node->overflow_link = HOST_ENDIAN_TO_BFS_INT64((uint64)BPLUSTREE_NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user