bcachefs: Fix printbuf usage while atomic
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 22 Jul 2024 15:25:03 +0000 (11:25 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 22 Jul 2024 15:27:15 +0000 (11:27 -0400)
Reported-by: syzbot+f765e51170cf13493f0b@syzkaller.appspotmail.com
Fixes: f12410bb7ddd ("bcachefs: Add an error message for insufficient rw journal devs")
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_reclaim.c

index d8a6307..70b998d 100644 (file)
@@ -206,6 +206,7 @@ void bch2_journal_space_available(struct journal *j)
 
        if (nr_online < metadata_replicas_required(c)) {
                struct printbuf buf = PRINTBUF;
+               buf.atomic++;
                prt_printf(&buf, "insufficient writeable journal devices available: have %u, need %u\n"
                           "rw journal devs:", nr_online, metadata_replicas_required(c));