Commit 45b4ed52 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Repair subvol dirents that point to non subvols

when repair switches d_type to or from DT_SUBVOL, we need to update the
target accordingly
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent c60b7f80
...@@ -1678,6 +1678,12 @@ static int check_dirent_target(struct btree_trans *trans, ...@@ -1678,6 +1678,12 @@ static int check_dirent_target(struct btree_trans *trans,
bkey_reassemble(&n->k_i, d.s_c); bkey_reassemble(&n->k_i, d.s_c);
n->v.d_type = inode_d_type(target); n->v.d_type = inode_d_type(target);
if (n->v.d_type == DT_SUBVOL) {
n->v.d_parent_subvol = cpu_to_le32(target->bi_parent_subvol);
n->v.d_child_subvol = cpu_to_le32(target->bi_subvol);
} else {
n->v.d_inum = cpu_to_le64(target->bi_inum);
}
ret = bch2_trans_update(trans, iter, &n->k_i, 0); ret = bch2_trans_update(trans, iter, &n->k_i, 0);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment