Bug 206835
Summary: | btrfs partitions with xxhash checksum fail to mount on ppc64 | ||
---|---|---|---|
Product: | File System | Reporter: | Erhard F. (erhard_f) |
Component: | btrfs | Assignee: | BTRFS virtual assignee (fs_btrfs) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | dsterba |
Priority: | P1 | ||
Hardware: | PPC-64 | ||
OS: | Linux | ||
Kernel Version: | 5.5.9 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
dmesg (kernel 5.5.9, Talos II)
kernel .config (kernel 5.5.9, Talos II) |
Description
Erhard F.
2020-03-12 21:50:09 UTC
Created attachment 287901 [details]
kernel .config (kernel 5.5.9, Talos II)
DOes this happen with the other hashes, like sha256? No, does not happen with crc32, sha256 and blake2b. These can be cleanly mounted and unmounted after formatting. So this looks like a difference in implementation of the userspace and kernel of xxhash. Can you please try this patch to btrfs-progs: --- a/crypto/hash.c +++ b/crypto/hash.c @@ -23,6 +23,7 @@ int hash_xxhash(const u8 *buf, size_t length, u8 *out) * NOTE: we're not taking the canonical form here but the plain hash to * be compatible with the kernel implementation! */ + hash = bswap_64(hash); memcpy(out, &hash, 8); return 0; --- It switches the endianity. This naturally does not work on intel but on a big endian machine this might be the missing step. Yep, this works! Though somehow the patch did not apply to btrfs-progs v5.4.1. Had to edit crypto/hash.c manually. Great, thanks for testing, proper fix will be in the next release. |