bcachefs: Fix flushing held btree writes when there's a fs error
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 12 Oct 2019 20:44:44 +0000 (16:44 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:29 +0000 (17:08 -0400)
Previously, we'd go into an infinite loop.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.c

index 81418d534d706ff8b279fec2258198d9f28b0016..7d5d94dbc64f1590c7eece7f6dc6f6fdc934cfc6 100644 (file)
@@ -1438,6 +1438,9 @@ again:
        cond_resched();
        nodes_unwritten = false;
 
+       if (bch2_journal_error(&c->journal))
+               return true;
+
        rcu_read_lock();
        for_each_cached_btree(b, c, tbl, i, pos)
                if (btree_node_need_write(b)) {