summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-19 02:48:27 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:25 -0400
commit78c8fe20be12d0e4b6427d9149fd1eb9a69e2290 (patch)
tree72c720328ea264212feecd81b1ca1f72b28bf852 /fs/bcachefs/recovery.c
parentb66b2bc0f64a57c042ea1fa51dbd5904557bf67f (diff)
downloadlwn-78c8fe20be12d0e4b6427d9149fd1eb9a69e2290.tar.gz
lwn-78c8fe20be12d0e4b6427d9149fd1eb9a69e2290.zip
bcachefs: Normal update/commit path now works before going RW
This improves __bch2_trans_commit - early in the recovery process, when we're running btree_gc and before we want to go RW, it now uses bch2_journal_key_insert() to add the update to the list of updates for journal replay to do, instead of btree_gc having to use separate interfaces depending on whether we're running at bringup or, later, runtime. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index d33b9e2bb1e3..ae9ae1c7138c 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1157,6 +1157,7 @@ use_clean:
clear_bit(BCH_FS_REBUILD_REPLICAS, &c->flags);
set_bit(BCH_FS_INITIAL_GC_DONE, &c->flags);
+ set_bit(BCH_FS_MAY_GO_RW, &c->flags);
/*
* Skip past versions that might have possibly been used (as nonces),
@@ -1317,6 +1318,7 @@ int bch2_fs_initialize(struct bch_fs *c)
mutex_unlock(&c->sb_lock);
set_bit(BCH_FS_INITIAL_GC_DONE, &c->flags);
+ set_bit(BCH_FS_MAY_GO_RW, &c->flags);
set_bit(BCH_FS_FSCK_DONE, &c->flags);
for (i = 0; i < BTREE_ID_NR; i++)