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>
This commit is contained in:
Kent Overstreet 2022-04-12 20:03:19 -04:00 committed by Kent Overstreet
parent 41fc862224
commit 75c8d0305a
5 changed files with 12 additions and 29 deletions

View file

@ -518,7 +518,6 @@ enum {
/* misc: */
BCH_FS_NEED_ANOTHER_GC,
BCH_FS_DELETED_NODES,
BCH_FS_REBUILD_REPLICAS,
};
struct btree_debug {

View 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);

View 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;

View 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(), \

View 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 @@ int bch2_fs_recovery(struct bch_fs *c)
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 @@ int bch2_fs_recovery(struct bch_fs *c)
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);