summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-10-23 17:37:23 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:45 -0400
commitc167f9e54100179a009051ad6eac1dfb0bcd21f6 (patch)
treeb2689f7103c5b36ccc82947b398e4ed71638c182 /fs/bcachefs/recovery.c
parent1f69368c5cfce6770d101aaeff46ef22d22de07c (diff)
downloadlwn-c167f9e54100179a009051ad6eac1dfb0bcd21f6.tar.gz
lwn-c167f9e54100179a009051ad6eac1dfb0bcd21f6.zip
bcachefs: Journal keys overlay fixes
- In the btree iterator code that overlays keys from the journal, we were incorrectly specifying level=0 instead of the btree_path's current level in a few places - When we didn't do journal replay, we shouldn't free the journal keys: this fixes cmd_list and cmd_dump, which run in norecovery mode Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 580ff915d0e6..b2379adcf8ae 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1398,7 +1398,8 @@ out:
set_bit(BCH_FS_FSCK_DONE, &c->flags);
bch2_flush_fsck_errs(c);
- if (!c->opts.keep_journal) {
+ if (!c->opts.keep_journal &&
+ test_bit(JOURNAL_REPLAY_DONE, &c->journal.flags)) {
bch2_journal_keys_free(&c->journal_keys);
bch2_journal_entries_free(c);
}