bcachefs: Dump journal state when the journal deadlocks

Currently tracking down one of these bugs.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-11-16 18:21:55 -05:00 committed by Kent Overstreet
parent dbd1e8259a
commit e8bd002b23

View file

@ -414,8 +414,17 @@ static int __journal_res_get(struct journal *j, struct journal_res *res,
goto retry;
if (ret == -ENOSPC) {
WARN_ONCE(!can_discard && (flags & JOURNAL_RES_GET_RESERVED),
"JOURNAL_RES_GET_RESERVED set but journal full");
if (WARN_ONCE(!can_discard && (flags & JOURNAL_RES_GET_RESERVED),
"JOURNAL_RES_GET_RESERVED set but journal full")) {
char *buf;
buf = kmalloc(4096, GFP_NOFS);
if (buf) {
bch2_journal_debug_to_text(&_PBUF(buf, 4096), j);
pr_err("\n%s", buf);
kfree(buf);
}
}
/*
* Journal is full - can't rely on reclaim from work item due to