engine_rd: Ignore backfill buffer allocation error

It's OK to proceed with a read even if failed to allocate a buffer for backfill

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
Michal Mielewczyk
2024-08-28 14:07:42 +02:00
parent a3bccbba6c
commit 9c65ec955f
2 changed files with 25 additions and 14 deletions

View File

@@ -103,21 +103,25 @@ static inline void _ocf_read_generic_submit_miss(struct ocf_request *req)
req->cp_data = ctx_data_alloc(cache->owner,
BYTES_TO_PAGES(req->byte_length));
if (!req->cp_data)
if (!req->cp_data) {
/* If buffer allocation for backfill fails, ignore the error */
ocf_cache_log(cache, log_warn, "Backfill buffer allocation "
"error (size %u)\n",
req->byte_length);
goto err_alloc;
}
ret = ctx_data_mlock(cache->owner, req->cp_data);
if (ret)
goto err_alloc;
if (ret) {
ocf_cache_log(cache, log_warn, "Backfill error\n");
ctx_data_free(cache->owner, req->cp_data);
req->cp_data = NULL;
}
err_alloc:
/* Submit read request to core device. */
ocf_submit_volume_req(&req->core->volume, req,
_ocf_read_generic_miss_complete);
return;
err_alloc:
_ocf_read_generic_miss_complete(req, -OCF_ERR_NO_MEM);
}
static int _ocf_read_generic_do(struct ocf_request *req)