diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-01 11:17:18 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-01 11:19:55 -0500 |
commit | f1c9030ccbf6d7b5c46f08f92ee878bfc9f6ee6b (patch) | |
tree | 1070f2d066e84d997f44749f985ae5e363927fc7 | |
parent | 06f0e6a47df117f9b24d406c68dbbe29ff7e1865 (diff) |
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>
-rw-r--r-- | fs/bcachefs/journal_io.c | 3 | ||||
-rw-r--r-- | fs/bcachefs/recovery.c | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 8c86bf063c5c..179361bea0e3 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -1188,8 +1188,7 @@ int bch2_journal_read(struct bch_fs *c, u64 *blacklist_seq, u64 *start_seq) if (!last_seq) { fsck_err(c, "journal read done, but no entries found after dropping non-flushes"); - ret = -1; - goto err; + return 0; } bch_info(c, "journal read done, replaying entries %llu-%llu", diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 7906e817db6e..af2628f43582 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1118,6 +1118,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; @@ -1189,13 +1196,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; |