From 86fa1258a3ef59adccdd1534e55ef773b82c4cb7 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 12 Aug 2020 15:08:17 -0400 Subject: bcachefs: Add a cond_resched() to bch2_alloc_write() Signed-off-by: Kent Overstreet --- fs/bcachefs/alloc_background.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 43b9f99194b9..9aa0b42b26b6 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -350,6 +350,8 @@ int bch2_alloc_write(struct bch_fs *c, unsigned flags, bool *wrote) bch2_btree_iter_set_pos(iter, POS(i, first_bucket)); while (1) { + bch2_trans_cond_resched(&trans); + ret = bch2_alloc_write_key(&trans, iter, flags); if (ret < 0 || ret == ALLOC_END) break; -- cgit v1.2.3