Skip to content

Commit ef488bb

Browse files
author
Kent Overstreet
committed
bcachefs: Fix 'hung task' messages in btree node scan
btree node scan has to wait on kthread workers that scan each device, potentially for awhile. We would like this to be interruptible, but we may need a different mechanism than signals for that - we've had bugs in the past where mounts were failing due to checking for signals, and no explanation on where they came from. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 9314e2f commit ef488bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/bcachefs/btree_node_scan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <linux/kthread.h>
1515
#include <linux/min_heap.h>
16+
#include <linux/sched/sysctl.h>
1617
#include <linux/sort.h>
1718

1819
struct find_btree_nodes_worker {
@@ -313,7 +314,8 @@ static int read_btree_nodes(struct find_btree_nodes *f)
313314
wake_up_process(t);
314315
}
315316
err:
316-
closure_sync(&cl);
317+
while (closure_sync_timeout(&cl, sysctl_hung_task_timeout_secs * HZ / 2))
318+
;
317319
return f->ret ?: ret;
318320
}
319321

0 commit comments

Comments
 (0)