Fix freeing oversized discard requests

When issuing discard request over 512KiB OCF would trim this request and
overwrite req->core_line_count which would then cause this request to be
freed from wrong mpool.

This is fixed now by saving core_line_count that was set when allocating
this request that is never overwritten. This alloc_core_line_count is
then used to free the request from correct mpool.

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial
2021-03-25 14:00:17 +01:00
parent b12e124954
commit 9c070c1d25
2 changed files with 13 additions and 8 deletions

View File

@@ -166,6 +166,9 @@ struct ocf_request {
uint32_t core_line_count;
/*! Core line count */
uint32_t alloc_core_line_count;
/*! Number of core lines at time of request allocation */
int error;
/*!< This filed indicates an error for OCF request */