Commit 72644db1 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix an assertion when rebuilding replicas

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 02f1a96c
...@@ -679,7 +679,8 @@ void bch2_btree_ptr_debugcheck(struct bch_fs *c, struct btree *b, ...@@ -679,7 +679,8 @@ void bch2_btree_ptr_debugcheck(struct bch_fs *c, struct btree *b,
goto err; 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), bch2_bkey_val_to_text(c, btree_node_type(b),
buf, sizeof(buf), k); buf, sizeof(buf), k);
bch2_fs_bug(c, bch2_fs_bug(c,
...@@ -1713,7 +1714,8 @@ static void bch2_extent_debugcheck_extent(struct bch_fs *c, struct btree *b, ...@@ -1713,7 +1714,8 @@ static void bch2_extent_debugcheck_extent(struct bch_fs *c, struct btree *b,
return; 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), bch2_bkey_val_to_text(c, btree_node_type(b),
buf, sizeof(buf), e.s_c); buf, sizeof(buf), e.s_c);
bch2_fs_bug(c, bch2_fs_bug(c,
......
...@@ -219,6 +219,8 @@ int bch2_fs_recovery(struct bch_fs *c) ...@@ -219,6 +219,8 @@ int bch2_fs_recovery(struct bch_fs *c)
goto err; goto err;
bch_verbose(c, "mark and sweep done"); bch_verbose(c, "mark and sweep done");
clear_bit(BCH_FS_REBUILD_REPLICAS, &c->flags);
if (c->opts.noreplay) if (c->opts.noreplay)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment