diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-03 22:00:50 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2019-04-03 12:43:24 -0400 |
commit | e9be4f766bbc22b29bbed97e808816e28f75d2e2 (patch) | |
tree | 8f7a9e0975c7424f1112afb32fc45956961d3855 | |
parent | 495bbc911b2d83ad081e1b822d6dfb404b9f6f3a (diff) |
bcachefs: Fix an assertion when rebuilding replicas
-rw-r--r-- | fs/bcachefs/extents.c | 6 | ||||
-rw-r--r-- | fs/bcachefs/recovery.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index 6eaa89c92595..ef36d244ab24 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 95b4e244429d..902f39f659c2 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -218,6 +218,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; |