From 98124aa13da4e4e7e7f77912d6fbe249ce749aaa Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Wed, 17 Mar 2021 11:23:24 -0500 Subject: [PATCH] Add missing lookup in engine_map() Early return from engine_map() in case of insufficient free cachelines on the freelist is opportunistic, as both request map info and freelist count are not accurate. Map info is stale as it is to be refreshed in engine_map() after hash bucket lock had been upgraded. Freelist count on other hand is subject to change asynchronously. The implementation assumption however is that after engine_map() request is fully traversed (engine_map() is equivalent to engine_lookup() followed by an attempt to map missing cachelines). So in case of early return we must take care of repeating the lookup. Signed-off-by: Adam Rutkowski --- src/engine/engine_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/engine/engine_common.c b/src/engine/engine_common.c index 3310800..ca3d1f0 100644 --- a/src/engine/engine_common.c +++ b/src/engine/engine_common.c @@ -404,6 +404,7 @@ static void ocf_engine_map(struct ocf_request *req) if (ocf_engine_unmapped_count(req) > ocf_freelist_num_free(cache->freelist)) { + ocf_engine_lookup(req); ocf_req_set_mapping_error(req); return; }