]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bcachefs: Print allocator stuck on timeout in fallocate path
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 11 Jul 2024 18:08:38 +0000 (14:08 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 14 Jul 2024 23:00:11 +0000 (19:00 -0400)
same as in io_write.c, if we're waiting on the allocator for an
excessive amount of time, print what's going on

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io_misc.c

index 4583c9386e8c10f5f61f83e7cf11dac26daf5cf5..2cf6297756f8e1eab9b87fb3fbe806a0604510a5 100644 (file)
@@ -126,7 +126,11 @@ err_noprint:
 
        if (closure_nr_remaining(&cl) != 1) {
                bch2_trans_unlock_long(trans);
-               closure_sync(&cl);
+
+               if (closure_sync_timeout(&cl, HZ * 10)) {
+                       bch2_print_allocator_stuck(c);
+                       closure_sync(&cl);
+               }
        }
 
        return ret;