diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-09 21:13:37 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:50 -0400 |
commit | 06ab86d596170b9f3b88ce3f8e9fea7e9c1ea0c2 (patch) | |
tree | 2df837f9d64edd6532cbf3cd32be818c37d831d9 /fs/bcachefs/btree_update_interior.c | |
parent | 434b1c75a4e79ee63cd58225567f752311cf3cd0 (diff) | |
download | linux-06ab86d596170b9f3b88ce3f8e9fea7e9c1ea0c2.tar.gz linux-06ab86d596170b9f3b88ce3f8e9fea7e9c1ea0c2.tar.bz2 linux-06ab86d596170b9f3b88ce3f8e9fea7e9c1ea0c2.zip |
bcachefs: Fix btree_node_write_blocked() not being cleared
The btree_node_write_blocked bit was a later addition to this code,
it only mirrors the state of the b->write_blocked list (empty or
nonempty) - unfortunately, when it was added it wasn't correctly kept in
sync - oops.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_update_interior.c')
-rw-r--r-- | fs/bcachefs/btree_update_interior.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 566838317845..4e9c963dbd23 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -161,6 +161,7 @@ static void __btree_node_free(struct bch_fs *c, struct btree *b) { trace_and_count(c, btree_node_free, c, b); + BUG_ON(btree_node_write_blocked(b)); BUG_ON(btree_node_dirty(b)); BUG_ON(btree_node_need_write(b)); BUG_ON(b == btree_node_root(c, b)); @@ -807,6 +808,7 @@ static void btree_update_updated_node(struct btree_update *as, struct btree *b) BUG_ON(as->mode != BTREE_INTERIOR_NO_UPDATE); BUG_ON(!btree_node_dirty(b)); + BUG_ON(!b->c.level); as->mode = BTREE_INTERIOR_UPDATING_NODE; as->b = b; @@ -976,6 +978,7 @@ static void bch2_btree_interior_update_will_free_node(struct btree_update *as, clear_btree_node_dirty_acct(c, b); clear_btree_node_need_write(b); + clear_btree_node_write_blocked(b); /* * Does this node have unwritten data that has a pin on the journal? |