accel_sw: add extra check on compression
We were missing a check when ISAL uses the complete output buffer on compression to determine whether it was s perfect fit or if simply not enough buffer was provided. Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: I73532666f50cb9fbef3c42f6bfb25fc5c7de01c6 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14874 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
parent
aa22e6f774
commit
13597fd4f1
@ -203,8 +203,13 @@ _sw_accel_compress(struct sw_accel_io_channel *sw_ch, struct spdk_accel_task *ac
|
||||
assert(sw_ch->stream.avail_out > 0);
|
||||
} else {
|
||||
/* we have no avail_out but also no more iovecs left so this is
|
||||
* the case where the output buffer was a perfect fit for the
|
||||
* compressed data and we're done. */
|
||||
* the case where either the output buffer was a perfect fit
|
||||
* or not enough was provided. Check the ISAL state to determine
|
||||
* which. */
|
||||
if (sw_ch->stream.internal_state.state != ZSTATE_END) {
|
||||
SPDK_ERRLOG("Not enough destination buffer provided.\n");
|
||||
rc = -ENOMEM;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user