Skip to content

Commit

Permalink
QAT: Fix uninitialized seed in QAT compression
Browse files Browse the repository at this point in the history
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
  • Loading branch information
naivekun committed Mar 11, 2023
1 parent 950980b commit a3b6916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/os/linux/zfs/qat_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ qat_compress_impl(qat_compress_dir_t dir, char *src, int src_len,
Cpa8U *buffer_meta_src = NULL;
Cpa8U *buffer_meta_dst = NULL;
Cpa32U buffer_meta_size = 0;
CpaDcRqResults dc_results;
CpaDcRqResults dc_results = {.checksum = 1};
CpaStatus status = CPA_STATUS_FAIL;
Cpa32U hdr_sz = 0;
Cpa32U compressed_sz;
Expand Down

0 comments on commit a3b6916

Please sign in to comment.