summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-12 20:03:19 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-05-30 18:17:21 -0400
commitc9b8f7394da4d4e8951554c2e58601f17de3cc6e (patch)
tree789749753efee9306bf6a8fa275c06ede41caad3
parent1e1f55a93b149b2bce76e61c4337a8eab925f242 (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>
-rw-r--r--fs/bcachefs/bcachefs.h1
-rw-r--r--fs/bcachefs/buckets.c7
-rw-r--r--fs/bcachefs/journal_io.c9
-rw-r--r--fs/bcachefs/opts.h5
-rw-r--r--fs/bcachefs/recovery.c19
5 files changed, 12 insertions, 29 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index e29a0891134b..2a38b3ea7e1f 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 54b1d23f4f34..09736cf56862 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -378,10 +378,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 ea1dff95117b..a5413af7d7dd 100644
--- a/fs/bcachefs/journal_io.c
+++ b/fs/bcachefs/journal_io.c
@@ -1055,7 +1055,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;
@@ -1212,10 +1212,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 8bc67d07afb9..85f029602eb5 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 a9b4ad177051..10b46eb54ca8 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);