diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-03 20:49:23 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 23:29:22 +0200 |
commit | e98786ea855cb28176e27ffce23fb163a36ed32e (patch) | |
tree | db7adc56c0a1b5eb177b04041b0f8386b767e2f3 /fs/bcachefs/io_write.c | |
parent | closures: closure_sync_timeout() (diff) | |
download | linux-e98786ea855cb28176e27ffce23fb163a36ed32e.tar.xz linux-e98786ea855cb28176e27ffce23fb163a36ed32e.zip |
bcachefs: bch2_print_allocator_stuck()
If we block on the allocator for more than 10 seconds, print out some
useful debugging info.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io_write.c')
-rw-r--r-- | fs/bcachefs/io_write.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index e96dad0dd60d..55e24c83fb19 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -1494,7 +1494,11 @@ err: if ((op->flags & BCH_WRITE_SYNC) || (!(op->flags & BCH_WRITE_DONE) && !(op->flags & BCH_WRITE_IN_WORKER))) { - closure_sync(&op->cl); + if (closure_sync_timeout(&op->cl, HZ * 10)) { + bch2_print_allocator_stuck(c); + closure_sync(&op->cl); + } + __bch2_write_index(op); if (!(op->flags & BCH_WRITE_DONE)) |