summaryrefslogtreecommitdiff
path: root/libbcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-10 03:42:28 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2022-02-11 18:33:16 -0500
commit9c79275419a92de852536cdb3f2fde954c10bc31 (patch)
tree4dab68f7faea1fa72a133912e7179891386b80f3 /libbcachefs/recovery.c
parent7b15324de1095f3e2e423e9c53da076d208b52d5 (diff)
Update bcachefs sources to b84661c042 bcachefs: Fix reflink repair code
Diffstat (limited to 'libbcachefs/recovery.c')
-rw-r--r--libbcachefs/recovery.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/libbcachefs/recovery.c b/libbcachefs/recovery.c
index b818093e..7e4400cc 100644
--- a/libbcachefs/recovery.c
+++ b/libbcachefs/recovery.c
@@ -1095,7 +1095,11 @@ use_clean:
bch_verbose(c, "starting alloc read");
err = "error reading allocation information";
- ret = bch2_alloc_read(c);
+
+ down_read(&c->gc_lock);
+ ret = bch2_alloc_read(c, false, false);
+ up_read(&c->gc_lock);
+
if (ret)
goto err;
bch_verbose(c, "alloc read done");
@@ -1153,23 +1157,6 @@ use_clean:
if (c->opts.verbose || !c->sb.clean)
bch_info(c, "journal replay done");
- if (test_bit(BCH_FS_NEED_ALLOC_WRITE, &c->flags) &&
- !c->opts.nochanges) {
- /*
- * note that even when filesystem was clean there might be work
- * to do here, if we ran gc (because of fsck) which recalculated
- * oldest_gen:
- */
- bch_verbose(c, "writing allocation info");
- err = "error writing out alloc info";
- ret = bch2_alloc_write_all(c, BTREE_INSERT_LAZY_RW);
- if (ret) {
- bch_err(c, "error writing alloc info");
- goto err;
- }
- bch_verbose(c, "alloc write done");
- }
-
if (c->sb.version < bcachefs_metadata_version_snapshot_2) {
bch2_fs_lazy_rw(c);