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 <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2019-10-12 16:44:44 -04:00 committed by Kent Overstreet
parent f38fe2dc5d
commit ae93a62895

View file

@ -1438,6 +1438,9 @@ static bool flush_held_btree_writes(struct bch_fs *c)
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)) {