diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-01 11:17:18 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:47 -0400 |
commit | e0de429a3ab5f9485ca781d6d4d7368a2e12d835 (patch) | |
tree | 88fbbc790d51b84eed8a77d6e3c9248d05adf60e /fs/bcachefs/recovery.c | |
parent | 6f90e6b28180cb567b0abdb753ccac4c7d840cb2 (diff) | |
download | lwn-e0de429a3ab5f9485ca781d6d4d7368a2e12d835.tar.gz lwn-e0de429a3ab5f9485ca781d6d4d7368a2e12d835.zip |
bcachefs: Don't error out when just reading the journal
This tweaks the recovery and journal paths so that we don't error out
before we need to: the list_journal command should work, even if we
wouldn't be able to replay successfully.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r-- | fs/bcachefs/recovery.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 7c9f4a97bc03..aff813e3e360 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1113,6 +1113,13 @@ int bch2_fs_recovery(struct bch_fs *c) if (ret) goto err; + /* + * note: cmd_list_journal needs the blacklist table fully up to date so + * it can asterisk ignored journal entries: + */ + if (c->opts.read_journal_only) + goto out; + genradix_for_each_reverse(&c->journal_entries, iter, i) if (*i && !(*i)->ignore) { last_journal_entry = &(*i)->j; @@ -1184,13 +1191,6 @@ use_clean: } } - /* - * note: cmd_list_journal needs the blacklist table fully up to date so - * it can asterisk ignored journal entries: - */ - if (c->opts.read_journal_only) - goto out; - ret = bch2_fs_journal_start(&c->journal, journal_seq); if (ret) goto err; |