diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-06 14:13:15 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-06 14:13:15 -0400 |
commit | 790ca9522a96efe321aae36fb0d7f4e437110b0f (patch) | |
tree | 06b208f7671ee218bcaa11876a7fb37f1806f3d7 /libbcachefs/recovery.c | |
parent | 498874fdb71973c1856f35414bd607e58be16790 (diff) |
Update bcachefs sources to e027cf9aa0 fixup! bcachefs: Defer checking of alloc -> lru refs until after RW
Diffstat (limited to 'libbcachefs/recovery.c')
-rw-r--r-- | libbcachefs/recovery.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libbcachefs/recovery.c b/libbcachefs/recovery.c index 6a92c1a0..88ed8030 100644 --- a/libbcachefs/recovery.c +++ b/libbcachefs/recovery.c @@ -471,7 +471,7 @@ void bch2_journal_keys_free(struct journal_keys *keys) kvfree(keys->d); keys->d = NULL; - keys->nr = 0; + keys->nr = keys->gap = keys->size = 0; } static struct journal_keys journal_keys_sort(struct list_head *journal_entries) @@ -1237,7 +1237,7 @@ use_clean: if (c->opts.fsck) { bch_info(c, "checking need_discard and freespace btrees"); err = "error checking need_discard and freespace btrees"; - ret = bch2_check_alloc_info(c, true); + ret = bch2_check_alloc_info(c); if (ret) goto err; @@ -1276,6 +1276,19 @@ use_clean: if (ret) goto err; + if (c->opts.fsck) { + bch_info(c, "checking alloc to lru refs"); + err = "error checking alloc to lru refs"; + ret = bch2_check_alloc_to_lru_refs(c); + if (ret) + goto err; + + ret = bch2_check_lrus(c, true); + if (ret) + goto err; + bch_verbose(c, "done checking alloc to lru refs"); + } + if (c->sb.version < bcachefs_metadata_version_snapshot_2) { bch2_fs_lazy_rw(c); |