Commit 5d04409a authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Always flush write buffer in delete_dead_inodes()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent b6fc661f
......@@ -1181,6 +1181,15 @@ int bch2_delete_dead_inodes(struct bch_fs *c)
bool need_another_pass;
int ret;
again:
/*
* if we ran check_inodes() unlinked inodes will have already been
* cleaned up but the write buffer will be out of sync; therefore we
* alway need a write buffer flush
*/
ret = bch2_btree_write_buffer_flush_sync(trans);
if (ret)
goto err;
need_another_pass = false;
/*
......@@ -1213,12 +1222,8 @@ int bch2_delete_dead_inodes(struct bch_fs *c)
ret;
}));
if (!ret && need_another_pass) {
ret = bch2_btree_write_buffer_flush_sync(trans);
if (ret)
goto err;
if (!ret && need_another_pass)
goto again;
}
err:
bch2_trans_put(trans);
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment