From 241bcd01833274da114b709d2f2b13d4429c7fd9 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 25 May 2025 17:05:55 -0400 Subject: Fix infinite loop in cmd_list_journal list_journal can print the entire contents of the journal, and non-dirty entries don't get validated, so we have to account for that. Signed-off-by: Kent Overstreet --- libbcachefs/journal_io.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libbcachefs/journal_io.c') diff --git a/libbcachefs/journal_io.c b/libbcachefs/journal_io.c index 06f7b018..82205376 100644 --- a/libbcachefs/journal_io.c +++ b/libbcachefs/journal_io.c @@ -418,6 +418,9 @@ static void journal_entry_btree_keys_to_text(struct printbuf *out, struct bch_fs bool first = true; jset_entry_for_each_key(entry, k) { + if (!k->k.u64s) + break; + if (!first) { prt_newline(out); bch2_prt_jset_entry_type(out, entry->type); -- cgit v1.2.3