diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-11-17 02:21:55 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:47 +0300 |
commit | e8bd002b23813f162d83a5c5c3b28832ba88f78e (patch) | |
tree | ebda7889455f54ef002558f87ceecb98dea0c7ea | |
parent | dbd1e8259ad2b35aafe230fdabfa387b3b54ab64 (diff) | |
download | linux-e8bd002b23813f162d83a5c5c3b28832ba88f78e.tar.xz |
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>
-rw-r--r-- | fs/bcachefs/journal.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index e7b60876d09a..32555ccffc0e 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -414,8 +414,17 @@ unlock: 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 |