Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4 -23
+4 -23
fs/bcachefs/fsck.c
··· 1713 1713 return ret; 1714 1714 } 1715 1715 1716 - static int check_subvol_dirent(struct btree_trans *trans, struct btree_iter *iter, 1717 - struct bkey_s_c_dirent d) 1716 + static int check_dirent_to_subvol(struct btree_trans *trans, struct btree_iter *iter, 1717 + struct bkey_s_c_dirent d) 1718 1718 { 1719 1719 struct bch_fs *c = trans->c; 1720 1720 struct bch_inode_unpacked subvol_root; ··· 1724 1724 int ret = 0; 1725 1725 1726 1726 ret = subvol_lookup(trans, target_subvol, 1727 - &target_snapshot, &target_inum); 1727 + &target_snapshot, &target_inum); 1728 1728 if (ret && !bch2_err_matches(ret, ENOENT)) 1729 1729 return ret; 1730 1730 ··· 1737 1737 &subvol_root, &target_snapshot); 1738 1738 if (ret && !bch2_err_matches(ret, ENOENT)) 1739 1739 return ret; 1740 - 1741 - if (fsck_err_on(ret, c, subvol_to_missing_root, 1742 - "subvolume %u points to missing subvolume root %llu", 1743 - target_subvol, 1744 - target_inum)) { 1745 - bch_err(c, "repair not implemented yet"); 1746 - return -EINVAL; 1747 - } 1748 - 1749 - if (fsck_err_on(subvol_root.bi_subvol != target_subvol, 1750 - c, subvol_root_wrong_bi_subvol, 1751 - "subvol root %llu has wrong bi_subvol field: got %u, should be %u", 1752 - target_inum, 1753 - subvol_root.bi_subvol, target_subvol)) { 1754 - subvol_root.bi_subvol = target_subvol; 1755 - ret = __bch2_fsck_write_inode(trans, &subvol_root, target_snapshot); 1756 - if (ret) 1757 - return ret; 1758 - } 1759 1740 1760 1741 ret = check_dirent_target(trans, iter, d, &subvol_root, 1761 1742 target_snapshot); ··· 1830 1849 d = bkey_s_c_to_dirent(k); 1831 1850 1832 1851 if (d.v->d_type == DT_SUBVOL) { 1833 - ret = check_subvol_dirent(trans, iter, d); 1852 + ret = check_dirent_to_subvol(trans, iter, d); 1834 1853 if (ret) 1835 1854 goto err; 1836 1855 } else {