Fix error accounting in forward_io

Resetting cache_error/core_error in ocf_req_forward_* functions may lead
to overwriting already reported error if the forward is being done in the
loop.

To avoid this potential problem, introduce set of forward init functions
intended to be called before the entire forward operation, which resets
the error code and sets a forward callback.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga
2024-10-14 16:54:51 +02:00
parent 6ad1007e6f
commit a1af1809d8
12 changed files with 61 additions and 50 deletions

View File

@@ -62,7 +62,7 @@ static int ocf_read_wo_cache_do(struct ocf_request *req)
uint64_t offset = 0;
uint64_t increment = 0;
req->cache_forward_end = ocf_read_wo_cache_complete;
ocf_req_forward_cache_init(req, ocf_read_wo_cache_complete);
ocf_req_forward_cache_get(req);