summaryrefslogtreecommitdiff
path: root/libbcachefs/journal.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-10-09 19:49:05 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-10-09 19:49:17 -0400
commit1d68a6da59573436f139b93f17febb426578cd81 (patch)
treee41002be02f0017c079c0e84a2680f36539b2cc9 /libbcachefs/journal.c
parentc4456b47148a5506606be73de3a736bce7508d95 (diff)
Update bcachefs sources to 3b80552e7057 bcachefs: __wait_for_freeing_inode: Switch to wait_bit_queue_entryv1.13.0
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/journal.c')
-rw-r--r--libbcachefs/journal.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libbcachefs/journal.c b/libbcachefs/journal.c
index f5f7db50..dc099f06 100644
--- a/libbcachefs/journal.c
+++ b/libbcachefs/journal.c
@@ -603,6 +603,19 @@ int bch2_journal_res_get_slowpath(struct journal *j, struct journal_res *res,
{
int ret;
+ if (closure_wait_event_timeout(&j->async_wait,
+ (ret = __journal_res_get(j, res, flags)) != -BCH_ERR_journal_res_get_blocked ||
+ (flags & JOURNAL_RES_GET_NONBLOCK),
+ HZ * 10))
+ return ret;
+
+ struct bch_fs *c = container_of(j, struct bch_fs, journal);
+ struct printbuf buf = PRINTBUF;
+ bch2_journal_debug_to_text(&buf, j);
+ bch_err(c, "Journal stuck? Waited for 10 seconds...\n%s",
+ buf.buf);
+ printbuf_exit(&buf);
+
closure_wait_event(&j->async_wait,
(ret = __journal_res_get(j, res, flags)) != -BCH_ERR_journal_res_get_blocked ||
(flags & JOURNAL_RES_GET_NONBLOCK));