]> git.proxmox.com Git - mirror_zfs.git/commit
Fix QAT allocation failure return value
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Jan 2020 19:17:53 +0000 (11:17 -0800)
committerGitHub <noreply@github.com>
Mon, 6 Jan 2020 19:17:53 +0000 (11:17 -0800)
commitbc9cef11fddfe8e6e240477084a49f4bad1fb4f3
treec76ef6d1afa9d7d77d09a00b7d1355cabfc88637
parent581ca28169eaa2c3285057876f42bab3314051ad
Fix QAT allocation failure return value

When qat_compress() fails to allocate the required contiguous memory
it mistakenly returns success.  This prevents the fallback software
compression from taking over and (un)compressing the block.

Resolve the issue by correctly setting the local 'status' variable
on all exit paths.  Furthermore, initialize it to CPA_STATUS_FAIL
to ensure qat_compress() always fails safe to guard against any
similar bugs in the future.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9784
Closes #9788
module/os/linux/zfs/qat_compress.c