From d57c9bb51d727d6cd4a7c15806f803d36d7ca586 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 12 Sep 2023 19:50:41 +0200 Subject: [PATCH] Unlock request in PT using ocf_req_unlock() There are situations when we can end up in engine_pt with cache lines locked for write. One example is engine_rd falling back to engine_pt after failure during cache line preparation, where write lock has been already taken. To handle this situation properly, unlock request using more general unlock function. Signed-off-by: Robert Baldyga --- src/engine/engine_pt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/engine_pt.c b/src/engine/engine_pt.c index d49faa96..6d3c53dd 100644 --- a/src/engine/engine_pt.c +++ b/src/engine/engine_pt.c @@ -1,5 +1,6 @@ /* * Copyright(c) 2012-2022 Intel Corporation + * Copyright(c) 2023 Huawei Technologies * SPDX-License-Identifier: BSD-3-Clause */ #include "ocf/ocf.h" @@ -35,7 +36,7 @@ static void _ocf_read_pt_complete(struct ocf_request *req, int error) /* Complete request */ req->complete(req, req->error); - ocf_req_unlock_rd(ocf_cache_line_concurrency(req->cache), req); + ocf_req_unlock(ocf_cache_line_concurrency(req->cache), req); /* Release OCF request */ ocf_req_put(req);