aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-03 22:00:50 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:11 -0400
commit72644db153e6d3fc146d2c805dcba5b5d676cd99 (patch)
tree102a6884e03d17176d011cedcde109cd6dc4a717
parent02f1a96c135a7c99518261bf8d244091416c30c6 (diff)
bcachefs: Fix an assertion when rebuilding replicas
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/extents.c6
-rw-r--r--fs/bcachefs/recovery.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 4a62eefd40cd..e2bb1502eaad 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -679,7 +679,8 @@ void bch2_btree_ptr_debugcheck(struct bch_fs *c, struct btree *b,
goto err;
}
- if (!bch2_bkey_replicas_marked(c, btree_node_type(b), e.s_c)) {
+ if (!test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags) &&
+ !bch2_bkey_replicas_marked(c, btree_node_type(b), e.s_c)) {
bch2_bkey_val_to_text(c, btree_node_type(b),
buf, sizeof(buf), k);
bch2_fs_bug(c,
@@ -1713,7 +1714,8 @@ static void bch2_extent_debugcheck_extent(struct bch_fs *c, struct btree *b,
return;
}
- if (!bch2_bkey_replicas_marked(c, btree_node_type(b), e.s_c)) {
+ if (!test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags) &&
+ !bch2_bkey_replicas_marked(c, btree_node_type(b), e.s_c)) {
bch2_bkey_val_to_text(c, btree_node_type(b),
buf, sizeof(buf), e.s_c);
bch2_fs_bug(c,
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 2fd68a39d76a..e21551e8d6cc 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -219,6 +219,8 @@ int bch2_fs_recovery(struct bch_fs *c)
goto err;
bch_verbose(c, "mark and sweep done");
+ clear_bit(BCH_FS_REBUILD_REPLICAS, &c->flags);
+
if (c->opts.noreplay)
goto out;