diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-07 08:06:14 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-14 04:22:24 +0300 |
commit | ea27001e14e963547df6ae60edc70332fcd02c37 (patch) | |
tree | 4f18e6b8e517917a3a6bc87d64f4e25e610cdb89 /fs/bcachefs | |
parent | e539ebb8674c74ab26d707965bcca2fe3fc17b43 (diff) | |
download | linux-ea27001e14e963547df6ae60edc70332fcd02c37.tar.xz |
bcachefs: delete duplicated checks in check_dirent_to_subvol()
these were already checked in check_subvol()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/fsck.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index fa96f63492d1..9069701028a9 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -1713,8 +1713,8 @@ fsck_err: return ret; } -static int check_subvol_dirent(struct btree_trans *trans, struct btree_iter *iter, - struct bkey_s_c_dirent d) +static int check_dirent_to_subvol(struct btree_trans *trans, struct btree_iter *iter, + struct bkey_s_c_dirent d) { struct bch_fs *c = trans->c; struct bch_inode_unpacked subvol_root; @@ -1724,7 +1724,7 @@ static int check_subvol_dirent(struct btree_trans *trans, struct btree_iter *ite int ret = 0; ret = subvol_lookup(trans, target_subvol, - &target_snapshot, &target_inum); + &target_snapshot, &target_inum); if (ret && !bch2_err_matches(ret, ENOENT)) return ret; @@ -1738,25 +1738,6 @@ static int check_subvol_dirent(struct btree_trans *trans, struct btree_iter *ite if (ret && !bch2_err_matches(ret, ENOENT)) return ret; - if (fsck_err_on(ret, c, subvol_to_missing_root, - "subvolume %u points to missing subvolume root %llu", - target_subvol, - target_inum)) { - bch_err(c, "repair not implemented yet"); - return -EINVAL; - } - - if (fsck_err_on(subvol_root.bi_subvol != target_subvol, - c, subvol_root_wrong_bi_subvol, - "subvol root %llu has wrong bi_subvol field: got %u, should be %u", - target_inum, - subvol_root.bi_subvol, target_subvol)) { - subvol_root.bi_subvol = target_subvol; - ret = __bch2_fsck_write_inode(trans, &subvol_root, target_snapshot); - if (ret) - return ret; - } - ret = check_dirent_target(trans, iter, d, &subvol_root, target_snapshot); if (ret) @@ -1849,7 +1830,7 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter, d = bkey_s_c_to_dirent(k); if (d.v->d_type == DT_SUBVOL) { - ret = check_subvol_dirent(trans, iter, d); + ret = check_dirent_to_subvol(trans, iter, d); if (ret) goto err; } else { |