Skip to content

Commit

Permalink
bcachefs: Don't start rewriting btree nodes until after journal replay
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
Kent Overstreet committed Dec 9, 2024
1 parent f5adb0a commit dd7d7f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/bcachefs/btree_update_interior.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,8 @@ void bch2_btree_node_rewrite_async(struct bch_fs *c, struct btree *b)
bool now = false, pending = false;

spin_lock(&c->btree_node_rewrites_lock);
if (bch2_write_ref_tryget(c, BCH_WRITE_REF_node_rewrite)) {
if (c->curr_recovery_pass > BCH_RECOVERY_PASS_journal_replay &&
bch2_write_ref_tryget(c, BCH_WRITE_REF_node_rewrite)) {
list_add(&a->list, &c->btree_node_rewrites);
now = true;
} else if (!test_bit(BCH_FS_may_go_rw, &c->flags)) {
Expand Down

0 comments on commit dd7d7f2

Please sign in to comment.