]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: Add a cond_resched() to bch2_alloc_write()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 12 Aug 2020 19:08:17 +0000 (15:08 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:43 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c

index ba7620999a8dd12b147627da139d4b1bff81592e..fd8b57c806cc5d1e615f4fb9051687be2eea3306 100644 (file)
@@ -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;