mirror of
https://github.com/versity/scoutfs.git
synced 2026-08-29 04:06:57 +00:00
Set read node parent through ref
The code was using parent_ref() to set the parent ref's node pointer. But parent_ref() uses the parent's left node pointer to determine which ref points to the node. If we were setting the left it would return the right because the left isn't set yet. This messed up the tree shape and all hell broke loose. Just set it through the ref, we have it anyway. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
+1
-1
@@ -590,7 +590,7 @@ retry:
|
||||
memcpy(node->data, tnode->data, bytes);
|
||||
|
||||
node->parent = parent;
|
||||
parent_ref(treap, node)->node = node;
|
||||
ref->node = node;
|
||||
ret = 0;
|
||||
out:
|
||||
release_ring_node(tnode);
|
||||
|
||||
Reference in New Issue
Block a user