bcachefs: Fix btree node merge -> split operations
If a btree node merger is followed by a split or compact of the parent node, we could end up with the parent btree node iterator pointing to the whiteout inserted by the btree node merge operation - the fix is to ensure that interior btree node iterators always point to the first non whiteout. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
5b9bf43c81
commit
537c49d6af
@ -902,6 +902,13 @@ static inline void __btree_iter_init(struct btree_iter *iter,
|
||||
|
||||
bch2_btree_node_iter_init(&l->iter, l->b, &pos);
|
||||
|
||||
/*
|
||||
* Iterators to interior nodes should always be pointed at the first non
|
||||
* whiteout:
|
||||
*/
|
||||
if (level)
|
||||
bch2_btree_node_iter_peek(&l->iter, l->b);
|
||||
|
||||
btree_iter_set_dirty(iter, BTREE_ITER_NEED_PEEK);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user