From: Kent Overstreet Date: Sat, 12 Oct 2019 20:44:44 +0000 (-0400) Subject: bcachefs: Fix flushing held btree writes when there's a fs error X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ae93a628956c8eab915baa83be11d2a0300eebca;p=linux.git bcachefs: Fix flushing held btree writes when there's a fs error Previously, we'd go into an infinite loop. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 81418d534d706..7d5d94dbc64f1 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -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)) {