Skip to content

Commit e1e50a6

Browse files
author
Kent Overstreet
committed
bcachefs: Use print_string_as_lines() for journal stuck messages
They were being truncated, printk has a 1k limit per call Signed-off-by: Kent Overstreet <[email protected]>
1 parent a76db26 commit e1e50a6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/bcachefs/journal.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ static void bch2_journal_buf_to_text(struct printbuf *out, struct journal *j, u6
6262
prt_newline(out);
6363
}
6464

65-
prt_printf(out, "expires:\t");
66-
prt_printf(out, "%li jiffies\n", buf->expires - jiffies);
65+
prt_printf(out, "expires:\t%li jiffies\n", buf->expires - jiffies);
6766

6867
prt_printf(out, "flags:\t");
6968
if (buf->noflush)
@@ -142,6 +141,8 @@ journal_error_check_stuck(struct journal *j, int error, unsigned flags)
142141
bool stuck = false;
143142
struct printbuf buf = PRINTBUF;
144143

144+
buf.atomic++;
145+
145146
if (!(error == -BCH_ERR_journal_full ||
146147
error == -BCH_ERR_journal_pin_full) ||
147148
nr_unwritten_journal_entries(j) ||
@@ -172,7 +173,7 @@ journal_error_check_stuck(struct journal *j, int error, unsigned flags)
172173
bch_err(c, "Journal stuck! Hava a pre-reservation but journal full (error %s)",
173174
bch2_err_str(error));
174175
bch2_journal_debug_to_text(&buf, j);
175-
bch_err(c, "%s", buf.buf);
176+
bch2_print_string_as_lines(KERN_ERR, buf.buf);
176177

177178
printbuf_reset(&buf);
178179
bch2_journal_pins_to_text(&buf, j);
@@ -726,10 +727,10 @@ int bch2_journal_res_get_slowpath(struct journal *j, struct journal_res *res,
726727
remaining_wait))
727728
return ret;
728729

730+
bch_err(c, "Journal stuck? Waited for 10 seconds, err %s", bch2_err_str(ret));
729731
struct printbuf buf = PRINTBUF;
730732
bch2_journal_debug_to_text(&buf, j);
731-
bch_err(c, "Journal stuck? Waited for 10 seconds...\n%s",
732-
buf.buf);
733+
bch2_print_string_as_lines(KERN_ERR, buf.buf);
733734
printbuf_exit(&buf);
734735

735736
closure_wait_event(&j->async_wait,

0 commit comments

Comments
 (0)