From: Kent Overstreet Date: Tue, 7 Jun 2022 03:04:33 +0000 (-0400) Subject: bcachefs: Fix for cmd_list_journal X-Git-Tag: v6.7-rc1~201^2~941 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2aa02657561b0e6d96089eb8ee44e4154f4acad;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index edb04f65a148c..5fe7595d36be2 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1175,9 +1175,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); @@ -1208,6 +1205,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;