From: Kent Overstreet Date: Fri, 23 May 2025 17:13:44 +0000 (-0400) Subject: bcachefs: Fix endianness in casefold check/repair X-Git-Tag: block-6.16-20250606~39^2~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=016c4b48b86d18b14f8a45beabefc5ccf7caf594;p=linux-block.git bcachefs: Fix endianness in casefold check/repair Fixes: 010c89468134 ("bcachefs: Check for casefolded dirents in non casefolded dirs") Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index dbfa3e0b8abb..49f46df8340e 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -2204,11 +2204,11 @@ static int check_dirent(struct btree_trans *trans, struct btree_iter *iter, buf.buf))) { struct qstr name = bch2_dirent_get_name(d); u32 subvol = d.v->d_type == DT_SUBVOL - ? d.v->d_parent_subvol + ? le32_to_cpu(d.v->d_parent_subvol) : 0; u64 target = d.v->d_type == DT_SUBVOL - ? d.v->d_child_subvol - : d.v->d_inum; + ? le32_to_cpu(d.v->d_child_subvol) + : le64_to_cpu(d.v->d_inum); u64 dir_offset; ret = bch2_hash_delete_at(trans, diff --git a/fs/bcachefs/sb-errors_format.h b/fs/bcachefs/sb-errors_format.h index 4036a20c6adc..0bfb151da9cf 100644 --- a/fs/bcachefs/sb-errors_format.h +++ b/fs/bcachefs/sb-errors_format.h @@ -209,7 +209,7 @@ enum bch_fsck_flags { x(subvol_to_missing_root, 188, 0) \ x(subvol_root_wrong_bi_subvol, 189, FSCK_AUTOFIX) \ x(bkey_in_missing_snapshot, 190, 0) \ - x(bkey_in_deleted_snapshot, 315, 0) \ + x(bkey_in_deleted_snapshot, 315, FSCK_AUTOFIX) \ x(inode_pos_inode_nonzero, 191, 0) \ x(inode_pos_blockdev_range, 192, 0) \ x(inode_alloc_cursor_inode_bad, 301, 0) \