summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_trans_commit.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-03 18:30:08 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-11-04 22:19:13 -0400
commitd3c7727bb9269c7f7a2f17ef76b9e5c9b8cc8863 (patch)
tree402a0d35410e968724409c01de6b112b332d73e4 /fs/bcachefs/btree_trans_commit.c
parent01ccee225a373d859eb6e5d42dbe0138a40a7e0a (diff)
downloadlwn-d3c7727bb9269c7f7a2f17ef76b9e5c9b8cc8863.tar.gz
lwn-d3c7727bb9269c7f7a2f17ef76b9e5c9b8cc8863.zip
bcachefs: rebalance_work btree is not a snapshots btree
rebalance_work entries may refer to entries in the extents btree, which is a snapshots btree, or they may also refer to entries in the reflink btree, which is not. Hence rebalance_work keys may use the snapshot field but it's not required to be nonzero - add a new btree flag to reflect this. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_trans_commit.c')
-rw-r--r--fs/bcachefs/btree_trans_commit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c
index 32693f7c6221..decad7b66c59 100644
--- a/fs/bcachefs/btree_trans_commit.c
+++ b/fs/bcachefs/btree_trans_commit.c
@@ -269,6 +269,7 @@ static inline void btree_insert_entry_checks(struct btree_trans *trans,
BUG_ON(i->level != i->path->level);
BUG_ON(i->btree_id != i->path->btree_id);
EBUG_ON(!i->level &&
+ btree_type_has_snapshots(i->btree_id) &&
!(i->flags & BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE) &&
test_bit(JOURNAL_REPLAY_DONE, &trans->c->journal.flags) &&
i->k->k.p.snapshot &&