diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-03 23:29:02 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-05 23:24:21 -0500 |
commit | 074cbcdaeee433a02d6d0565b936bee0915cc5da (patch) | |
tree | d2c7ee92dd86dca9a56e33dc8d5cfbe7c1881a60 /fs/bcachefs/fsck.c | |
parent | 15eaaa4c315547c1ec871956ad0752cb9f4b14ae (diff) | |
download | linux-074cbcdaeee433a02d6d0565b936bee0915cc5da.tar.gz linux-074cbcdaeee433a02d6d0565b936bee0915cc5da.tar.bz2 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.c | 16 |
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) |