Skip to content

Commit

Permalink
bcachefs: Add a cond_resched() to __journal_keys_sort()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Kent Overstreet committed Sep 5, 2024
1 parent 9b6737e commit b675b2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/bcachefs/btree_journal_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ static void __journal_keys_sort(struct journal_keys *keys)
{
sort(keys->data, keys->nr, sizeof(keys->data[0]), journal_sort_key_cmp, NULL);

cond_resched();

struct journal_key *dst = keys->data;

darray_for_each(*keys, src) {
Expand Down

0 comments on commit b675b2e

Please sign in to comment.