The patch titled Subject: reiserfs: add comment to explain endianness issue in xattr_hash has been added to the -mm tree. Its filename is reiserfs-add-comment-to-explain-endianness-issue-in-xattr_hash.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/reiserfs-add-comment-to-explain-endianness-issue-in-xattr_hash.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/reiserfs-add-comment-to-explain-endianness-issue-in-xattr_hash.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Bharath Vedartham <linux.bhar@xxxxxxxxx> Subject: reiserfs: add comment to explain endianness issue in xattr_hash csum_partial() gives different results for little-endian and big-endian hosts. This causes images created on little-endian hosts and mounted on big endian hosts to see csum mismatches. This causes an endianness bug. Sparse gives a warning as csum_partial returns a restricted integer type __wsum_t and xattr_hash expects __u32. This warning acts as a reminder for this bug and should not be suppressed. This comment aims to convey these endianness issues. Link: http://lkml.kernel.org/r/20190423161831.GA15387@bharath12345-Inspiron-5559 Signed-off-by: Bharath Vedartham <linux.bhar@xxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Jann Horn <jannh@xxxxxxxxxx> Cc: Jeff Mahoney <jeffm@xxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/reiserfs/xattr.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/fs/reiserfs/xattr.c~reiserfs-add-comment-to-explain-endianness-issue-in-xattr_hash +++ a/fs/reiserfs/xattr.c @@ -450,6 +450,16 @@ fail: static inline __u32 xattr_hash(const char *msg, int len) { + /* + * csum_partial() gives different results for little-endian and + * big endian hosts. Images created on little-endian hosts and + * mounted on big-endian hosts(and vice versa) will see csum mismatches + * when trying to fetch xattrs. Treating the hash as __wsum_t would + * lower the frequency of mismatch. This is an endianness bug in reiserfs. + * The return statement would result in a sparse warning. Do not fix the sparse + * warning so as to not hide the reminder of the bug. + */ + return csum_partial(msg, len, 0); } _ Patches currently in -mm which might be from linux.bhar@xxxxxxxxx are reiserfs-add-comment-to-explain-endianness-issue-in-xattr_hash.patch