bcachefs: zero init journal bios
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 21 Mar 2025 15:30:09 +0000 (11:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 24 Mar 2025 13:50:37 +0000 (09:50 -0400)
fix a kmsan splat

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal.c

index ce73026955470955575f3263d618fe85980ea9d1..bfdaea6569ae448d45ac8f2344ef7a0d3d2aee40 100644 (file)
@@ -1510,7 +1510,7 @@ int bch2_dev_journal_init(struct bch_dev *ca, struct bch_sb *sb)
        unsigned nr_bvecs = DIV_ROUND_UP(JOURNAL_ENTRY_SIZE_MAX, PAGE_SIZE);
 
        for (unsigned i = 0; i < ARRAY_SIZE(ja->bio); i++) {
-               ja->bio[i] = kmalloc(struct_size(ja->bio[i], bio.bi_inline_vecs,
+               ja->bio[i] = kzalloc(struct_size(ja->bio[i], bio.bi_inline_vecs,
                                     nr_bvecs), GFP_KERNEL);
                if (!ja->bio[i])
                        return -BCH_ERR_ENOMEM_dev_journal_init;