-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZFS 2.0.4 build issue on Linux/sparc64: __bswapdi2 and __bswapsi2 missing #12008
Comments
Oh, just adding that latest master commit (610cb4f) still suffers from the same issue. |
So, I fixed the immediate issue of those missing functions using an implementation from elsewhere in the codebase, but while the resulting module loads and passes almost every test I put it through, it fails on the minor issue that attempting to import it on one of my x86_64 systems results in errors reading many of the files. (These files read fine if the pool is then imported again on the originating sparc64 system.) So I'm suspicious that something in the ZFS glue code might be doing something endian-unsafe. (I'm reasonably confident the byteswap implementation is not the problem, having tried both the version from elsewhere in the codebase and the fallback version in zstd's own codebase, and gotten the same results.) |
i have fixed build on sparc64 for DilOS by commit: https://bitbucket.org/dilos/dilos-illumos/commits/0978372eb920c486b41b0a8d7d80f022a6774da8 |
@ikozhukhov have you tried importing any pools with zstd-compressed files written from the sun4[uv] systems on an x86 system, and reading those files? I tried overriding the definitions of clz[ds]i2 like you did just in case, and the resulting module has the same pathological behavior. |
zstd not working between SPARC <> Intel, but LZ4 and GZIP are both fine:
|
Unfortunately, that's consistent with what I'm seeing. So something is rotten here... |
Courtesy of some help from Allan Jude... It seems like the header information for the blocks are getting (endian?)mangled. Normally, zdb -Zddddddbbbbbb [dataset] [objid] would say When reading a file generated on x86_64 on sparc64, you see: (It seems important to note here that 10405 = 0x28a5, 2663683 = 0x28a503, and the compression level+version are stored in a 32bit struct together as 24b+8b .) (don't read anything into the size being different, these weren't the same object). Still poking around to see what's wrong - the endianness macros don't appear to obviously be broken, at least on the sparc64 side... |
Okay, I tentatively have a patch that fixes this. I'm going to do a bunch more testing and refinement (I haven't tried compiling it on anything except sparc64, for example...), but it does allow my sparc64 system to interoperably use zstd on a pool with an x86_64 machine. (Bonus fact: this also affected ppc64 systems, and I am presuming all big endian systems - the non-interoperable zstd, that is, ppc64 doesn't have the missing symbols this issue was opened about.) |
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64, and one written by current FBSD/ppc64. (I'll add one for Linux/sparc64 once the unmodified git checkout finishes building. Linux/ppc64 behaves identically to Linux/sparc64.) Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64, and one written by current FBSD/ppc64. (I'll add one for Linux/sparc64 once the unmodified git checkout finishes building. Linux/ppc64 behaves identically to Linux/sparc64.) Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64, and one written by current FBSD/ppc64. (I'll add one for Linux/sparc64 once the unmodified git checkout finishes building. Linux/ppc64 behaves identically to Linux/sparc64.) Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64, one for Linux/sparc64, and one written by FBSD/ppc64. Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64, one for Linux/sparc64, and one written by FBSD/ppc64. Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Whats the current status for this? Im affected as well on sparc64. |
I made #12022, if you have a burning need you could either run that or, if you absolutely don't plan to ever use zstd and don't want to run a large PR before it merges, just pick out the relevant changes for this bug from it. I would suggest asking in the PR, because AFAIK, there are no technical complaints outstanding. |
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. Fixes: openzfs#12008 Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
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 openzfs#12008 Closes openzfs#12022
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
As detailed in #12022 and #12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #12030
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 openzfs#12008 Closes openzfs#12022
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes openzfs#12030
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 openzfs#12008 Closes openzfs#12022
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes openzfs#12030
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
As detailed in #12022 and #12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes #12030
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 openzfs#12008 Closes openzfs#12022
As detailed in openzfs#12022 and openzfs#12008, it turns out the current zstd implementation is quite nonportable, and results in various configurations of ondisk header that only each platform can read. So I've added a test which contains a dataset with a file written by Linux/x86_64 and one written by FBSD/ppc64. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes openzfs#12030
System information
Describe the problem you're observing
ZFS codebase includes some byteswapping routines (mainly, in zstd code) that are implemented as
__builtin_bswap32
/__builtin_bswap64
, which then gets compiled into__bswapsi2
and__bswapdi2
libgcc calls. Those are missing when compiling as a kernel module, so I'm getting errors like these:I decided to file it here since it only happens when zstd is built as part of ZFS, but please let me know if I should file this to zstd people instead :)
Describe how to reproduce the problem
Build ZFS as usual on a sparc64 machine:
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: