Skip to content

Commit 570f505

Browse files
bharadwaj-rajuKent Overstreet
authored andcommitted
bcachefs: use nonblocking variant of print_string_as_lines in error path
The inconsistency error path calls print_string_as_lines, which calls console_lock, which is a potentially-sleeping function and so can't be called in an atomic context. Replace calls to it with the nonblocking variant which is safe to call. Signed-off-by: Bharadwaj Raju <bharadwaj.raju777@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent b2ffadc commit 570f505

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/bcachefs/error.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool __bch2_inconsistent_error(struct bch_fs *c, struct printbuf *out)
3434
journal_cur_seq(&c->journal));
3535
return true;
3636
case BCH_ON_ERROR_panic:
37-
bch2_print_string_as_lines(KERN_ERR, out->buf);
37+
bch2_print_string_as_lines_nonblocking(KERN_ERR, out->buf);
3838
panic(bch2_fmt(c, "panic after error"));
3939
return true;
4040
default:
@@ -71,7 +71,7 @@ static bool bch2_fs_trans_inconsistent(struct bch_fs *c, struct btree_trans *tra
7171
if (trans)
7272
bch2_trans_updates_to_text(&buf, trans);
7373
bool ret = __bch2_inconsistent_error(c, &buf);
74-
bch2_print_string_as_lines(KERN_ERR, buf.buf);
74+
bch2_print_string_as_lines_nonblocking(KERN_ERR, buf.buf);
7575

7676
printbuf_exit(&buf);
7777
return ret;

0 commit comments

Comments
 (0)