-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
QAT: Fix uninitialized seed in QAT compression #14632
Conversation
CpaDcRqResults have to be initialized with checksum=1 for adler32. Otherwise when error CPA_DC_OVERFLOW occured, the next compress operation will continue on previously part-compressed data, and write invalid checksum data. When zfs decompress the compressed data, a invalid checksum will occured and lead to openzfs#14463 Signed-off-by: naivekun <naivekun0817@gmail.com> Closes: openzfs#14463
@naivekun thanks for the fix! It looks good to me. |
hi @naivekun, thank you very much for finding and fixing this problem! Weigang and I discussed this issue, We think the patch is very good. Thank you again for your patch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged. Thanks everybody, I'll open a PR to get this included in the 2.1.10 release. |
CpaDcRqResults have to be initialized with checksum=1 for adler32. Otherwise when error CPA_DC_OVERFLOW occurred, the next compress operation will continue on previously part-compressed data, and write invalid checksum data. When zfs decompress the compressed data, a invalid checksum will occurred and lead to openzfs#14463 Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Weigang Li <weigang.li@intel.com> Reviewed-by: Chengfei Zhu <chengfeix.zhu@intel.com> Signed-off-by: naivekun <naivekun0817@gmail.com> Closes openzfs#14632 Closes openzfs#14463
CpaDcRqResults have to be initialized with checksum=1 for adler32. Otherwise when error CPA_DC_OVERFLOW occurred, the next compress operation will continue on previously part-compressed data, and write invalid checksum data. When zfs decompress the compressed data, a invalid checksum will occurred and lead to #14463 Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Weigang Li <weigang.li@intel.com> Reviewed-by: Chengfei Zhu <chengfeix.zhu@intel.com> Signed-off-by: naivekun <naivekun0817@gmail.com> Closes #14632 Closes #14463
CpaDcRqResults have to be initialized with checksum=1 for adler32. Otherwise when error CPA_DC_OVERFLOW occurred, the next compress operation will continue on previously part-compressed data, and write invalid checksum data. When zfs decompress the compressed data, a invalid checksum will occurred and lead to openzfs#14463 Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Weigang Li <weigang.li@intel.com> Reviewed-by: Chengfei Zhu <chengfeix.zhu@intel.com> Signed-off-by: naivekun <naivekun0817@gmail.com> Closes openzfs#14632 Closes openzfs#14463
CpaDcRqResults have to be initialized with checksum=1 for adler32. Otherwise when error CPA_DC_OVERFLOW occurred, the next compress operation will continue on previously part-compressed data, and write invalid checksum data. When zfs decompress the compressed data, a invalid checksum will occurred and lead to openzfs#14463 Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Weigang Li <weigang.li@intel.com> Reviewed-by: Chengfei Zhu <chengfeix.zhu@intel.com> Signed-off-by: naivekun <naivekun0817@gmail.com> Closes openzfs#14632 Closes openzfs#14463
Motivation and Context
#14463
Description
According to QAT example from intel, CpaDcRqResults have to be initialized with checksum=1 for adler32. Otherwise when error CPA_DC_OVERFLOW occurred, the next compression operation will continue on previously part-compressed data, and write invalid checksum data on disk. When ZFS decompress the compressed data, a invalid checksum will occurred and lead to issue #14463.
Reference doc:
330684-012-intel-qat-api-programmers-guide.pdf
Code example from Intel: https://github.com/intel/qatlib/blob/ff155a0778320ce7cff532bfa96a65ad35aa75f7/quickassist/lookaside/access_layer/src/sample_code/functional/dc/stateless_multi_op_checksum_sample/cpa_dc_stateless_multi_op_checksum_sample.c#L319
How Has This Been Tested?
Test platform
Xeon D-2177NT with three QAT device type c62x
Test version
Test setup
service qat start && modprobe zfs && service zfs-zed start
zpool create testpool /dev/nvme0n1
zfs set compression=gzip testpool
Test result
As shown in #14463, without this patch, data on disk will decompress failed and lead to kernel panic. With CpaDcRqResults initialized with checksum=1, everything works fine.
Types of changes
Checklist:
Signed-off-by
.