]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/btree_gc.c
Update bcachefs sources to da7d42a9a2 bcachefs: Add new assertions for shutdown path
[bcachefs-tools-debian] / libbcachefs / btree_gc.c
index 1fc386761d9799763eb618ffef6b85742134699a..c47d5d8caa62e94d0c0e5c2ee1a50c039dcf3882 100644 (file)
@@ -1810,7 +1810,7 @@ again:
 
        if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG) ||
            (BCH_SB_HAS_TOPOLOGY_ERRORS(c->disk_sb.sb) &&
-            !test_bit(BCH_FS_INITIAL_GC_DONE, &c->flags) &&
+            c->curr_recovery_pass <= BCH_RECOVERY_PASS_check_allocations &&
             c->opts.fix_errors != FSCK_OPT_NO)) {
                bch_info(c, "Starting topology repair pass");
                ret = bch2_repair_topology(c);
@@ -1825,7 +1825,7 @@ again:
 
        if (ret == -BCH_ERR_need_topology_repair &&
            !test_bit(BCH_FS_TOPOLOGY_REPAIR_DONE, &c->flags) &&
-           !test_bit(BCH_FS_INITIAL_GC_DONE, &c->flags)) {
+           c->curr_recovery_pass <= BCH_RECOVERY_PASS_check_allocations) {
                set_bit(BCH_FS_NEED_ANOTHER_GC, &c->flags);
                SET_BCH_SB_HAS_TOPOLOGY_ERRORS(c->disk_sb.sb, true);
                ret = 0;