diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-12 20:03:19 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:31 -0400 |
commit | 75c8d0305a5eecbe84b8ffef20e1c049f30f4123 (patch) | |
tree | 76073d5a57ad71416d86807bd304791943e25d43 /fs/bcachefs | |
parent | 41fc86222480c34d8647661b36d3fb1e9312fd33 (diff) |
bcachefs: Kill old rebuild_replicas option
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>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/bcachefs.h | 1 | ||||
-rw-r--r-- | fs/bcachefs/buckets.c | 7 | ||||
-rw-r--r-- | fs/bcachefs/journal_io.c | 9 | ||||
-rw-r--r-- | fs/bcachefs/opts.h | 5 | ||||
-rw-r--r-- | fs/bcachefs/recovery.c | 19 |
5 files changed, 12 insertions, 29 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index 43e921b91d85..04d297b1da94 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -518,7 +518,6 @@ enum { /* misc: */ BCH_FS_NEED_ANOTHER_GC, BCH_FS_DELETED_NODES, - BCH_FS_REBUILD_REPLICAS, }; struct btree_debug { diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 7fa76e737aa7..14c9c1098522 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -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); diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 9e43914ebd6a..a6a8737e92ad 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -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; diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h index ce79e1a12bd0..863891dcb554 100644 --- a/fs/bcachefs/opts.h +++ b/fs/bcachefs/opts.h @@ -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(), \ diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index dc11eae1bcaa..e2474ff99702 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -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); |