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 <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-09-05 15:43:03 -04:00
parent 5a6e43af1e
commit ec36573dcd

View File

@ -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); sort(keys->data, keys->nr, sizeof(keys->data[0]), journal_sort_key_cmp, NULL);
cond_resched();
struct journal_key *dst = keys->data; struct journal_key *dst = keys->data;
darray_for_each(*keys, src) { darray_for_each(*keys, src) {