summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/fsck.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-01-04 05:29:02 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-06 05:24:21 +0100
commit074cbcdaeee433a02d6d0565b936bee0915cc5da (patch)
treed2c7ee92dd86dca9a56e33dc8d5cfbe7c1881a60 /fs/bcachefs/fsck.c
parentbcachefs: Upgrades now specify errors to fix, like downgrades (diff)
downloadlinux-074cbcdaeee433a02d6d0565b936bee0915cc5da.tar.xz
linux-074cbcdaeee433a02d6d0565b936bee0915cc5da.zip
bcachefs: fsck_err()s don't need to manually check c->sb.version anymore
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r--fs/bcachefs/fsck.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index de1617ec1b59..4f0ecd605675 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -870,8 +870,7 @@ static int check_inode(struct btree_trans *trans,
return 0;
}
- if (u.bi_flags & BCH_INODE_unlinked &&
- c->sb.version >= bcachefs_metadata_version_deleted_inodes) {
+ if (u.bi_flags & BCH_INODE_unlinked) {
ret = check_inode_deleted_list(trans, k.k->p);
if (ret < 0)
return ret;
@@ -1594,13 +1593,12 @@ static int check_dirent_target(struct btree_trans *trans,
d = dirent_i_to_s_c(n);
}
- if (d.v->d_type == DT_SUBVOL &&
- target->bi_parent_subvol != le32_to_cpu(d.v->d_parent_subvol) &&
- (c->sb.version < bcachefs_metadata_version_subvol_dirent ||
- fsck_err(c, dirent_d_parent_subvol_wrong,
- "dirent has wrong d_parent_subvol field: got %u, should be %u",
- le32_to_cpu(d.v->d_parent_subvol),
- target->bi_parent_subvol))) {
+ if (fsck_err_on(d.v->d_type == DT_SUBVOL &&
+ target->bi_parent_subvol != le32_to_cpu(d.v->d_parent_subvol),
+ c, dirent_d_parent_subvol_wrong,
+ "dirent has wrong d_parent_subvol field: got %u, should be %u",
+ le32_to_cpu(d.v->d_parent_subvol),
+ target->bi_parent_subvol)) {
n = bch2_trans_kmalloc(trans, bkey_bytes(d.k));
ret = PTR_ERR_OR_ZERO(n);
if (ret)