mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix cross-endian interoperability of zstd
It turns out that layouts of union bitfields are a pain, and the current code results in an inconsistent layout between BE and LE systems, leading to zstd-active datasets on one erroring out on the other. Switch everyone over to the LE layout, and add compatibility code to read both. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #12008 Closes #12022
This commit is contained in:
committed by
Tony Hutter
parent
4e8a639d5f
commit
fb823061b0
+4
-2
@@ -2211,7 +2211,8 @@ snprintf_zstd_header(spa_t *spa, char *blkbuf, size_t buflen,
|
||||
(void) snprintf(blkbuf + strlen(blkbuf),
|
||||
buflen - strlen(blkbuf),
|
||||
" ZSTD:size=%u:version=%u:level=%u:EMBEDDED",
|
||||
zstd_hdr.c_len, zstd_hdr.version, zstd_hdr.level);
|
||||
zstd_hdr.c_len, zfs_get_hdrversion(&zstd_hdr),
|
||||
zfs_get_hdrlevel(&zstd_hdr));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2235,7 +2236,8 @@ snprintf_zstd_header(spa_t *spa, char *blkbuf, size_t buflen,
|
||||
(void) snprintf(blkbuf + strlen(blkbuf),
|
||||
buflen - strlen(blkbuf),
|
||||
" ZSTD:size=%u:version=%u:level=%u:NORMAL",
|
||||
zstd_hdr.c_len, zstd_hdr.version, zstd_hdr.level);
|
||||
zstd_hdr.c_len, zfs_get_hdrversion(&zstd_hdr),
|
||||
zfs_get_hdrlevel(&zstd_hdr));
|
||||
|
||||
abd_return_buf_copy(pabd, buf, BP_GET_LSIZE(bp));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user