Skip to content

Commit 2b47102

Browse files
author
Kent Overstreet
committed
bcachefs: Reorder error messages that include journal debug
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 393a05a commit 2b47102

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

fs/bcachefs/journal.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ journal_error_check_stuck(struct journal *j, int error, unsigned flags)
168168
return stuck;
169169
}
170170
j->err_seq = journal_cur_seq(j);
171-
spin_unlock(&j->lock);
172171

173-
bch_err(c, "Journal stuck! Hava a pre-reservation but journal full (error %s)",
174-
bch2_err_str(error));
175-
bch2_journal_debug_to_text(&buf, j);
172+
__bch2_journal_debug_to_text(&buf, j);
173+
spin_unlock(&j->lock);
174+
prt_printf(&buf, bch2_fmt(c, "Journal stuck! Hava a pre-reservation but journal full (error %s)"),
175+
bch2_err_str(error));
176176
bch2_print_string_as_lines(KERN_ERR, buf.buf);
177177

178178
printbuf_reset(&buf);
@@ -727,10 +727,10 @@ int bch2_journal_res_get_slowpath(struct journal *j, struct journal_res *res,
727727
remaining_wait))
728728
return ret;
729729

730-
bch_err(c, "Journal stuck? Waited for 10 seconds, err %s", bch2_err_str(ret));
731730
struct printbuf buf = PRINTBUF;
732731
bch2_journal_debug_to_text(&buf, j);
733732
bch2_print_string_as_lines(KERN_ERR, buf.buf);
733+
prt_printf(&buf, bch2_fmt(c, "Journal stuck? Waited for 10 seconds, err %s"), bch2_err_str(ret));
734734
printbuf_exit(&buf);
735735

736736
closure_wait_event(&j->async_wait,

fs/bcachefs/journal_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,12 +2082,12 @@ CLOSURE_CALLBACK(bch2_journal_write)
20822082
struct printbuf buf = PRINTBUF;
20832083
buf.atomic++;
20842084

2085+
__bch2_journal_debug_to_text(&buf, j);
2086+
spin_unlock(&j->lock);
20852087
prt_printf(&buf, bch2_fmt(c, "Unable to allocate journal write at seq %llu for %zu sectors: %s"),
20862088
le64_to_cpu(w->data->seq),
20872089
vstruct_sectors(w->data, c->block_bits),
20882090
bch2_err_str(ret));
2089-
__bch2_journal_debug_to_text(&buf, j);
2090-
spin_unlock(&j->lock);
20912091
bch2_print_string_as_lines(KERN_ERR, buf.buf);
20922092
printbuf_exit(&buf);
20932093
}

0 commit comments

Comments
 (0)