]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Fix for cmd_list_journal
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 7 Jun 2022 03:04:33 +0000 (23:04 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:33 +0000 (17:09 -0400)
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 <kent.overstreet@gmail.com>
fs/bcachefs/recovery.c

index edb04f65a148c16b65baacf4b278f6291e825e49..5fe7595d36be2bf6265a6114f461a7e3e6e1db79 100644 (file)
@@ -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;