summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet2021-11-03 20:25:35 -0400
committerKent Overstreet2023-10-22 17:09:16 -0400
commit47f80bbf38df59e41c98fd1f9681cf63af82a5fd (patch)
tree213f8de8fe7ba49c16d0238d35d465b17629daa8
parentd647db314adb8b5b60224a7604566746e7203c22 (diff)
bcachefs: Fix check_inodes()
We were starting at the wrong btree position, and thus not actually checking any inodes - oops. Also, make check_key_has_snapshot() a mustfix fsck error, since later fsck code assumes that all keys have valid snapshot IDs. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/fsck.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 5bc04c7bbb83..8a9cfccf5ee8 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -669,7 +669,7 @@ static int check_key_has_snapshot(struct btree_trans *trans,
char buf[200];
int ret = 0;
- if (fsck_err_on(!snapshot_t(c, k.k->p.snapshot)->equiv, c,
+ if (mustfix_fsck_err_on(!snapshot_t(c, k.k->p.snapshot)->equiv, c,
"key in missing snapshot: %s",
(bch2_bkey_val_to_text(&PBUF(buf), c, k), buf)))
return bch2_btree_delete_at(trans, iter,
@@ -918,8 +918,7 @@ static int check_inodes(struct bch_fs *c, bool full)
bch2_trans_init(&trans, c, BTREE_ITER_MAX, 0);
- bch2_trans_iter_init(&trans, &iter, BTREE_ID_inodes,
- POS(BCACHEFS_ROOT_INO, 0),
+ bch2_trans_iter_init(&trans, &iter, BTREE_ID_inodes, POS_MIN,
BTREE_ITER_INTENT|
BTREE_ITER_PREFETCH|
BTREE_ITER_ALL_SNAPSHOTS);