diff options
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r-- | fs/bcachefs/error.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index 207f35d3cce2..5a6f54a539bb 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -305,6 +305,13 @@ int __bch2_fsck_err(struct bch_fs *c, bch2_sb_error_count(c, err); + printbuf_indent_add_nextline(out, 2); + +#ifdef BCACHEFS_LOG_PREFIX + if (strncmp(fmt, "bcachefs", 8)) + prt_printf(out, bch2_log_msg(c, "")); +#endif + va_start(args, fmt); prt_vprintf(out, fmt, args); va_end(args); @@ -354,11 +361,6 @@ int __bch2_fsck_err(struct bch_fs *c, s->nr++; } -#ifdef BCACHEFS_LOG_PREFIX - if (!strncmp(fmt, "bcachefs:", 9)) - prt_printf(out, bch2_log_msg(c, "")); -#endif - if ((flags & FSCK_AUTOFIX) && (c->opts.errors == BCH_ON_ERROR_continue || c->opts.errors == BCH_ON_ERROR_fix_safe)) { @@ -435,6 +437,15 @@ int __bch2_fsck_err(struct bch_fs *c, print = true; } print: + prt_newline(out); + + if (inconsistent) + bch2_inconsistent_error(c); + else if (exiting) + prt_printf(out, "Unable to continue, halting\n"); + else if (suppressing) + prt_printf(out, "Ratelimiting new instances of previous error\n"); + if (print) { if (bch2_fs_stdio_redirect(c)) bch2_print(c, "%s\n", out->buf); @@ -442,11 +453,6 @@ print: bch2_print_string_as_lines(KERN_ERR, out->buf); } - if (exiting) - bch_err(c, "Unable to continue, halting"); - else if (suppressing) - bch_err(c, "Ratelimiting new instances of previous error"); - if (s) s->ret = ret; @@ -514,7 +520,7 @@ int __bch2_bkey_fsck_err(struct bch_fs *c, prt_printf(&buf, " level=%u: ", from.level); bch2_bkey_val_to_text(&buf, c, k); - prt_str(&buf, "\n "); + prt_newline(&buf); va_list args; va_start(args, fmt); @@ -536,7 +542,7 @@ void bch2_flush_fsck_errs(struct bch_fs *c) list_for_each_entry_safe(s, n, &c->fsck_error_msgs, list) { if (s->ratelimited && s->last_msg) - bch_err(c, "Saw %llu errors like:\n %s", s->nr, s->last_msg); + bch_err(c, "Saw %llu errors like:\n %s", s->nr, s->last_msg); list_del(&s->list); kfree(s->last_msg); |