Skip to content

Commit

Permalink
Unlock request in PT using ocf_req_unlock()
Browse files Browse the repository at this point in the history
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 <robert.baldyga@huawei.com>
  • Loading branch information
robertbaldyga committed Sep 13, 2023
1 parent 016d7a8 commit d57c9bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/engine_pt.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d57c9bb

Please sign in to comment.