bcachefs: Add missing error handling
authorAlan Huang <mmpgouride@gmail.com>
Sat, 12 Apr 2025 10:20:49 +0000 (18:20 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 13 Apr 2025 11:56:28 +0000 (07:56 -0400)
Reported-by: syzbot+d10151bf01574a09a915@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/recovery.c

index d2b07f602da95a2fb83b101af9cdaf3a3a373f08..606d684e6f23fc6a8055bbbcfe12270561a17869 100644 (file)
@@ -1125,7 +1125,10 @@ int bch2_fs_initialize(struct bch_fs *c)
         * journal_res_get() will crash if called before this has
         * set up the journal.pin FIFO and journal.cur pointer:
         */
-       bch2_fs_journal_start(&c->journal, 1);
+       ret = bch2_fs_journal_start(&c->journal, 1);
+       if (ret)
+               goto err;
+
        set_bit(BCH_FS_accounting_replay_done, &c->flags);
        bch2_journal_set_replay_done(&c->journal);