diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-24 00:29:55 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-01 02:36:11 +0200 |
commit | 57339b24a0eda5433751e7e0f4a8ea1e23315f60 (patch) | |
tree | 4c2466ba4d4271d924599c301b0028c62f77b198 /fs | |
parent | bcachefs: Add checks for invalid snapshot IDs (diff) | |
download | linux-57339b24a0eda5433751e7e0f4a8ea1e23315f60.tar.xz linux-57339b24a0eda5433751e7e0f4a8ea1e23315f60.zip |
bcachefs: Don't do extent merging before journal replay is finished
We don't normally do extent updates this early in recovery, but some of
the repair paths have to and when we do, we don't want to do anything
that requires the snapshots table.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/btree_update.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_update.c b/fs/bcachefs/btree_update.c index a4b40c1656a5..8e47e260eba5 100644 --- a/fs/bcachefs/btree_update.c +++ b/fs/bcachefs/btree_update.c @@ -38,6 +38,9 @@ static noinline int extent_front_merge(struct btree_trans *trans, struct bkey_i *update; int ret; + if (unlikely(trans->journal_replay_not_finished)) + return 0; + update = bch2_bkey_make_mut_noupdate(trans, k); ret = PTR_ERR_OR_ZERO(update); if (ret) @@ -69,6 +72,9 @@ static noinline int extent_back_merge(struct btree_trans *trans, struct bch_fs *c = trans->c; int ret; + if (unlikely(trans->journal_replay_not_finished)) + return 0; + ret = bch2_key_has_snapshot_overwrites(trans, iter->btree_id, insert->k.p) ?: bch2_key_has_snapshot_overwrites(trans, iter->btree_id, k.k->p); if (ret < 0) |