Skip to content

Commit ec36573

Browse files
author
Kent Overstreet
committed
bcachefs: Add a cond_resched() to __journal_keys_sort()
Without this, we'd potentially sort multiple times without a cond_resched(), leading to hung task warnings on larger systems. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 5a6e43a commit ec36573

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/bcachefs/btree_journal_iter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ static void __journal_keys_sort(struct journal_keys *keys)
530530
{
531531
sort(keys->data, keys->nr, sizeof(keys->data[0]), journal_sort_key_cmp, NULL);
532532

533+
cond_resched();
534+
533535
struct journal_key *dst = keys->data;
534536

535537
darray_for_each(*keys, src) {

0 commit comments

Comments
 (0)