From: Kent Overstreet Date: Wed, 12 Aug 2020 19:08:17 +0000 (-0400) Subject: bcachefs: Add a cond_resched() to bch2_alloc_write() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f9adbb7d5d19dfa9425fad844dce32853d077e58;p=linux.git bcachefs: Add a cond_resched() to bch2_alloc_write() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index ba7620999a8dd..fd8b57c806cc5 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;