Skip to content

Commit e6b3a65

Browse files
author
Kent Overstreet
committed
bcachefs: Use bch2_print_string_as_lines for long err
printk strings get truncated to 1024 bytes; if we have a long error message (journal debug info) we need to use a helper. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent dd90864 commit e6b3a65

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

fs/bcachefs/journal_io.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,6 @@ CLOSURE_CALLBACK(bch2_journal_write)
19671967
struct journal *j = container_of(w, struct journal, buf[w->idx]);
19681968
struct bch_fs *c = container_of(j, struct bch_fs, journal);
19691969
struct bch_replicas_padded replicas;
1970-
struct printbuf journal_debug_buf = PRINTBUF;
19711970
unsigned nr_rw_members = 0;
19721971
int ret;
19731972

@@ -2011,11 +2010,15 @@ CLOSURE_CALLBACK(bch2_journal_write)
20112010
}
20122011

20132012
if (ret) {
2014-
__bch2_journal_debug_to_text(&journal_debug_buf, j);
2013+
struct printbuf buf = PRINTBUF;
2014+
buf.atomic++;
2015+
2016+
prt_printf(&buf, bch2_fmt(c, "Unable to allocate journal write: %s"),
2017+
bch2_err_str(ret));
2018+
__bch2_journal_debug_to_text(&buf, j);
20152019
spin_unlock(&j->lock);
2016-
bch_err(c, "Unable to allocate journal write:\n%s",
2017-
journal_debug_buf.buf);
2018-
printbuf_exit(&journal_debug_buf);
2020+
bch2_print_string_as_lines(KERN_ERR, buf.buf);
2021+
printbuf_exit(&buf);
20192022
goto err;
20202023
}
20212024

0 commit comments

Comments
 (0)