From: Kent Overstreet Date: Tue, 4 Apr 2023 17:25:06 +0000 (-0400) Subject: bcachefs: Add a cond_resched() call to journal_keys_sort() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2776369266ad04095204128d72cf0d429b5fb678;p=linux.git bcachefs: Add a cond_resched() call to journal_keys_sort() We're just doing cpu work here and it could take awhile, a cond_resched() is definitely needed. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 8cc8af6d29ef0..91a66b5916eb7 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -543,6 +543,8 @@ static int journal_keys_sort(struct bch_fs *c) if (!i || i->ignore) continue; + cond_resched(); + for_each_jset_key(k, entry, &i->j) { if (keys->nr == keys->size) { __journal_keys_sort(keys);