bcachefs: Kill old rebuild_replicas option
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 13 Apr 2022 00:03:19 +0000 (20:03 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:31 +0000 (17:09 -0400)
This option was useful when the replicas mechism was new and still being
debugged, but hasn't been used in ages - let's delete it.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/bcachefs.h
fs/bcachefs/buckets.c
fs/bcachefs/journal_io.c
fs/bcachefs/opts.h
fs/bcachefs/recovery.c

index 43e921b91d85f807892ce7f5e0be90a2659d9348..04d297b1da94b31a97a8614f07eabc00a2bfe24c 100644 (file)
@@ -518,7 +518,6 @@ enum {
        /* misc: */
        BCH_FS_NEED_ANOTHER_GC,
        BCH_FS_DELETED_NODES,
-       BCH_FS_REBUILD_REPLICAS,
 };
 
 struct btree_debug {
index 7fa76e737aa76e283800a55574ddbbfea09185da..14c9c10985220b4a913fda8a3a43cefe28415e0c 100644 (file)
@@ -382,10 +382,9 @@ static inline int update_replicas(struct bch_fs *c, struct bkey_s_c k,
 
        idx = bch2_replicas_entry_idx(c, r);
        if (idx < 0 &&
-           (test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags) ||
-            fsck_err(c, "no replicas entry\n"
-                     "  while marking %s",
-                     (bch2_bkey_val_to_text(&buf, c, k), buf.buf)))) {
+           fsck_err(c, "no replicas entry\n"
+                    "  while marking %s",
+                    (bch2_bkey_val_to_text(&buf, c, k), buf.buf))) {
                percpu_up_read(&c->mark_lock);
                ret = bch2_mark_replicas(c, r);
                percpu_down_read(&c->mark_lock);
index 9e43914ebd6a54ad9bc4f1f242d0fbc2d2591241..a6a8737e92ad5e524b006ad215a21f8060b0544b 100644 (file)
@@ -1054,7 +1054,7 @@ int bch2_journal_read(struct bch_fs *c, u64 *blacklist_seq, u64 *start_seq)
        jlist.ret = 0;
 
        for_each_member_device(ca, c, iter) {
-               if (!test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags) &&
+               if (!c->opts.fsck &&
                    !(bch2_dev_has_data(c, ca) & (1 << BCH_DATA_journal)))
                        continue;
 
@@ -1211,10 +1211,9 @@ int bch2_journal_read(struct bch_fs *c, u64 *blacklist_seq, u64 *start_seq)
                bch2_replicas_entry_to_text(&buf, &replicas.e);
 
                if (!degraded &&
-                   (test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags) ||
-                    fsck_err_on(!bch2_replicas_marked(c, &replicas.e), c,
-                                "superblock not marked as containing replicas %s",
-                                buf.buf))) {
+                   fsck_err_on(!bch2_replicas_marked(c, &replicas.e), c,
+                               "superblock not marked as containing replicas %s",
+                               buf.buf)) {
                        ret = bch2_mark_replicas(c, &replicas.e);
                        if (ret)
                                goto err;
index ce79e1a12bd045304c669e5d21e74eb86e99c82f..863891dcb554d9852e42e7824b86cd194e89ccab 100644 (file)
@@ -316,11 +316,6 @@ enum opt_type {
          OPT_BOOL(),                                                   \
          BCH2_NO_SB_OPT,               false,                          \
          NULL,         "Don't replay the journal")                     \
-       x(rebuild_replicas,             u8,                             \
-         OPT_FS|OPT_MOUNT,                                             \
-         OPT_BOOL(),                                                   \
-         BCH2_NO_SB_OPT,               false,                          \
-         NULL,         "Rebuild the superblock replicas section")      \
        x(keep_journal,                 u8,                             \
          0,                                                            \
          OPT_BOOL(),                                                   \
index dc11eae1bcaa901de30f9b2f4dd3a4d16df52b42..e2474ff99702419017b894012caa7a0571ad274b 100644 (file)
@@ -1087,12 +1087,6 @@ int bch2_fs_recovery(struct bch_fs *c)
                c->opts.fix_errors = FSCK_OPT_YES;
        }
 
-       if (!c->replicas.entries ||
-           c->opts.rebuild_replicas) {
-               bch_info(c, "building replicas info");
-               set_bit(BCH_FS_REBUILD_REPLICAS, &c->flags);
-       }
-
        if (!c->opts.nochanges) {
                if (c->sb.version < bcachefs_metadata_version_new_data_types) {
                        bch_info(c, "version prior to new_data_types, upgrade and fsck required");
@@ -1224,10 +1218,7 @@ use_clean:
        if (!c->opts.fsck)
                set_bit(BCH_FS_FSCK_DONE, &c->flags);
 
-       if (c->opts.fsck ||
-           !(c->sb.compat & (1ULL << BCH_COMPAT_alloc_info)) ||
-           !(c->sb.compat & (1ULL << BCH_COMPAT_alloc_metadata)) ||
-           test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags)) {
+       if (c->opts.fsck) {
                bool metadata_only = c->opts.norecovery;
 
                bch_info(c, "checking allocations");
@@ -1236,24 +1227,24 @@ use_clean:
                if (ret)
                        goto err;
                bch_verbose(c, "done checking allocations");
-       }
 
-       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);
                if (ret)
                        goto err;
+               bch_verbose(c, "done checking need_discard and freespace btrees");
 
+               bch_info(c, "checking lrus");
+               err = "error checking lrus";
                ret = bch2_check_lrus(c, true);
                if (ret)
                        goto err;
-               bch_verbose(c, "done checking need_discard and freespace btrees");
+               bch_verbose(c, "done checking lrus");
        }
 
        bch2_stripes_heap_start(c);
 
-       clear_bit(BCH_FS_REBUILD_REPLICAS, &c->flags);
        set_bit(BCH_FS_INITIAL_GC_DONE, &c->flags);
        set_bit(BCH_FS_MAY_GO_RW, &c->flags);