summaryrefslogtreecommitdiff
path: root/libbcachefs/journal_io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-05-25 17:05:55 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-25 17:05:55 -0400
commit241bcd01833274da114b709d2f2b13d4429c7fd9 (patch)
tree3d89ff4bef505134ab5c51a9f3319c03295ced50 /libbcachefs/journal_io.c
parentfa0a54c45c44e8ff3885ccc72a43fd2d96e01b14 (diff)
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/journal_io.c')
-rw-r--r--libbcachefs/journal_io.c3
1 files changed, 3 insertions, 0 deletions
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);