bcachefs: Ensure that new inodes hit underlying btree
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 30 Jul 2021 22:01:33 +0000 (18:01 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:10 +0000 (17:09 -0400)
commite3637266024de9bafa64f315d7d03cf0291ace6a
tree6575c12eef8b4029f412058c9ee8efb784cfca7b
parent0f120eac34f31e7e6c4904d9e92e2e95e2edfbaa
bcachefs: Ensure that new inodes hit underlying btree

Inode creation is done with non-cached btree iterators, but then in the
same transaction the inode may be updated again with a cached iterator -
it makes cache coherency easier if new inodes always land in the
underlying btree.

This patch adds a check to bch2_trans_update() - if the same key is
updated multiple times in the same transaction with both cached and non
cache iterators, use the non cached iterator.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update_leaf.c