diff --git a/fs/bcachefs/sb-clean.c b/fs/bcachefs/sb-clean.c index 47f10ab57f40..a10d3e6e8119 100644 --- a/fs/bcachefs/sb-clean.c +++ b/fs/bcachefs/sb-clean.c @@ -303,6 +303,7 @@ static void bch2_sb_clean_to_text(struct printbuf *out, struct bch_sb *sb, for (entry = clean->start; entry != vstruct_end(&clean->field); entry = vstruct_next(entry)) { + unsigned bytes = vstruct_bytes(entry); if ((void *) vstruct_next(entry) > vstruct_end(&clean->field)) break; @@ -310,6 +311,11 @@ static void bch2_sb_clean_to_text(struct printbuf *out, struct bch_sb *sb, !entry->u64s) continue; + printk("entry bytes:%u, jedu: %u, %s\n", bytes, + sizeof(struct jset_entry_dev_usage), __func__); + if (bytes < sizeof(struct jset_entry_dev_usage)) + continue; + bch2_journal_entry_to_text(out, NULL, entry); prt_newline(out); }