summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-03-19 00:35:50 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-25 18:49:46 +0300
commite1e50a63308f5f97587e89a17084a7fd65d4958f (patch)
treea9e526c83038d7faf07f0d64603c79390fc8ec2a
parenta76db26a96982857a306d3e9dbc7f44d5ae45d9d (diff)
downloadlinux-e1e50a63308f5f97587e89a17084a7fd65d4958f.tar.xz
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 <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/journal.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index bfdaea6569ae..ecb97d435f6a 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -62,8 +62,7 @@ static void bch2_journal_buf_to_text(struct printbuf *out, struct journal *j, u6
prt_newline(out);
}
- prt_printf(out, "expires:\t");
- prt_printf(out, "%li jiffies\n", buf->expires - jiffies);
+ prt_printf(out, "expires:\t%li jiffies\n", buf->expires - jiffies);
prt_printf(out, "flags:\t");
if (buf->noflush)
@@ -142,6 +141,8 @@ journal_error_check_stuck(struct journal *j, int error, unsigned flags)
bool stuck = false;
struct printbuf buf = PRINTBUF;
+ buf.atomic++;
+
if (!(error == -BCH_ERR_journal_full ||
error == -BCH_ERR_journal_pin_full) ||
nr_unwritten_journal_entries(j) ||
@@ -172,7 +173,7 @@ journal_error_check_stuck(struct journal *j, int error, unsigned flags)
bch_err(c, "Journal stuck! Hava a pre-reservation but journal full (error %s)",
bch2_err_str(error));
bch2_journal_debug_to_text(&buf, j);
- bch_err(c, "%s", buf.buf);
+ bch2_print_string_as_lines(KERN_ERR, buf.buf);
printbuf_reset(&buf);
bch2_journal_pins_to_text(&buf, j);
@@ -726,10 +727,10 @@ int bch2_journal_res_get_slowpath(struct journal *j, struct journal_res *res,
remaining_wait))
return ret;
+ bch_err(c, "Journal stuck? Waited for 10 seconds, err %s", bch2_err_str(ret));
struct printbuf buf = PRINTBUF;
bch2_journal_debug_to_text(&buf, j);
- bch_err(c, "Journal stuck? Waited for 10 seconds...\n%s",
- buf.buf);
+ bch2_print_string_as_lines(KERN_ERR, buf.buf);
printbuf_exit(&buf);
closure_wait_event(&j->async_wait,