Free zeroed metadata pages on update in raw_dynamic

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2021-09-03 14:49:53 +02:00
parent e23342cb0e
commit d5bd3fbd78

View File

@ -284,6 +284,12 @@ static int raw_dynamic_update_pages(ocf_cache_t cache,
/* When page is zero set, no need to allocate space for it */
if (cmp == 0) {
OCF_DEBUG_PARAM(cache, "Zero loaded %llu", i);
if (ctrl->pages[page + i]) {
env_secure_free(ctrl->pages[page + i],
PAGE_SIZE);
ctrl->pages[page + i] = NULL;
env_atomic_dec(&ctrl->count);
}
continue;
}