Commit 6e44568c authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Set BTREE_NODE_SEQ() correctly in merge path

BTREE_NODE_SEQ() is supposed to give us a time ordering of btree nodes
on disk, so that we can tell which btree node is newer if we ever have
to scan the entire device to find btree nodes.

The btree node merge path wasn't setting it correctly on the new node -
oops.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 5838c170
......@@ -1697,6 +1697,10 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
n = bch2_btree_node_alloc(as, b->c.level);
bch2_btree_update_add_new_node(as, n);
SET_BTREE_NODE_SEQ(n->data,
max(BTREE_NODE_SEQ(b->data),
BTREE_NODE_SEQ(m->data)) + 1);
btree_set_min(n, prev->data->min_key);
btree_set_max(n, next->data->max_key);
n->data->format = new_f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment