Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
LIST_HEAD(journal);
struct jset *j = NULL;
unsigned i;
+ bool run_gc = c->opts.fsck ||
+ !(c->sb.compat & (1ULL << BCH_COMPAT_FEAT_ALLOC_INFO));
int ret;
mutex_lock(&c->sb_lock);
goto err;
mustfix_fsck_err(c, "error reading btree root");
+ run_gc = true;
}
}
set_bit(BCH_FS_ALLOC_READ_DONE, &c->flags);
- if (!(c->sb.compat & (1ULL << BCH_COMPAT_FEAT_ALLOC_INFO)) ||
- c->opts.fsck) {
+ if (run_gc) {
bch_verbose(c, "starting mark and sweep:");
err = "error in recovery";
ret = bch2_gc(c, &journal, true);