From ae93a628956c8eab915baa83be11d2a0300eebca Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 12 Oct 2019 16:44:44 -0400 Subject: [PATCH] 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 --- fs/bcachefs/alloc_background.c | 3 +++ 1 file changed, 3 insertions(+) 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)) { -- 2.30.2