diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-23 23:18:43 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:01 +0300 |
commit | 1c8441bea5366ec1e4f077ab675b49a603d7cad8 (patch) | |
tree | d5728ca0923336de7a072bc7b5762e70d30c75b2 | |
parent | 58686a259ed28f1ee50cc0aaa039e986aa218e0c (diff) | |
download | linux-1c8441bea5366ec1e4f077ab675b49a603d7cad8.tar.xz |
bcachefs: Fix repair leading to replicas not marked
bch2_check_fix_ptrs() was being called after checking if the replicas
set was marked - but repair could change which replicas set needed to be
marked. Oops.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/btree_gc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c index a7ffd566d431..6983a1197905 100644 --- a/fs/bcachefs/btree_gc.c +++ b/fs/bcachefs/btree_gc.c @@ -330,6 +330,10 @@ static int bch2_gc_mark_key(struct bch_fs *c, enum btree_id btree_id, BUG_ON(bch2_journal_seq_verify && k->k->version.lo > journal_cur_seq(&c->journal)); + ret = bch2_check_fix_ptrs(c, btree_id, level, is_root, k); + if (ret) + goto err; + if (fsck_err_on(k->k->version.lo > atomic64_read(&c->key_version), c, "key version number higher than recorded: %llu > %llu", k->k->version.lo, @@ -346,8 +350,6 @@ static int bch2_gc_mark_key(struct bch_fs *c, enum btree_id btree_id, goto err; } } - - ret = bch2_check_fix_ptrs(c, btree_id, level, is_root, k); } ptrs = bch2_bkey_ptrs_c(*k); |