From 1495936db7d57b0ebcf30304d4f3a8703b6e2904 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Mon, 6 Jun 2022 23:04:33 -0400 Subject: bcachefs: Fix for cmd_list_journal cmd_list_journal wasn't correctly listing the most recent journal entries as blacklisted - because in the recovery path when just reading the journal, we were failing to add those to the blacklist table. Signed-off-by: Kent Overstreet --- fs/bcachefs/recovery.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 04afe2453b0b..d08ceb160ae0 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1169,9 +1169,6 @@ use_clean: blacklist_seq = journal_seq = le64_to_cpu(clean->journal_seq) + 1; } - if (c->opts.read_journal_only) - goto out; - if (c->opts.reconstruct_alloc) { c->sb.compat &= ~(1ULL << BCH_COMPAT_alloc_info); drop_alloc_keys(&c->journal_keys); @@ -1202,6 +1199,13 @@ 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; -- cgit v1.2.3