Especially in userspace, we sometime run into resource exhaustion issues
with starting up threads after mark and sweep/fsck.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
bch2_journal_space_available(j);
spin_unlock(&j->lock);
- return 0;
+ return bch2_journal_reclaim_start(j);
}
/* init/exit: */
void bch2_fs_read_only(struct bch_fs *c)
{
if (!test_bit(BCH_FS_RW, &c->flags)) {
- BUG_ON(c->journal.reclaim_thread);
+ bch2_journal_reclaim_stop(&c->journal);
return;
}
for_each_rw_member(ca, c, i)
bch2_wake_allocator(ca);
- ret = bch2_journal_reclaim_start(&c->journal);
- if (ret) {
- bch_err(c, "error starting journal reclaim: %i", ret);
- return ret;
- }
-
if (!early) {
ret = bch2_fs_read_write_late(c);
if (ret)