Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double completion in engine_wi #838

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/engine/engine_inv.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ static int _ocf_invalidate_do(struct ocf_request *req)
{
struct ocf_cache *cache = req->cache;

ENV_BUG_ON(env_atomic_read(&req->req_remaining));

ocf_hb_req_prot_lock_wr(req);
ocf_purge_map_info(req);
ocf_hb_req_prot_unlock_wr(req);
Expand Down
4 changes: 2 additions & 2 deletions src/engine/engine_wi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ static int ocf_write_wi_update_and_flush_metadata(struct ocf_request *req)

/* There are mapped cache line, need to remove them */

env_atomic_set(&req->req_remaining, 1); /* One core IO */

ocf_hb_req_prot_lock_wr(req); /*- Metadata WR access ---------------*/

/* Remove mapped cache lines from metadata */
Expand All @@ -90,6 +88,8 @@ static int ocf_write_wi_update_and_flush_metadata(struct ocf_request *req)
/* Request was dirty and need to flush metadata */
ocf_metadata_flush_do_asynch(cache, req,
_ocf_write_wi_io_flush_metadata);

return 0;
}

_ocf_write_wi_io_flush_metadata(req, 0);
Expand Down
1 change: 0 additions & 1 deletion src/engine/engine_zero.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ static int _ocf_zero_do(struct ocf_request *req)
ocf_zero_map_info(req);

/* Discard marked cache lines */
env_atomic_set(&req->req_remaining, 1);
if (req->info.flush_metadata) {
/* Request was dirty and need to flush metadata */
ocf_metadata_flush_do_asynch(cache, req,
Expand Down
2 changes: 0 additions & 2 deletions src/metadata/metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,6 @@ void ocf_metadata_flush_do_asynch(struct ocf_cache *cache,
* line persistent in case of recovery
*/

env_atomic_inc(&req->req_remaining); /* Core device IO */

result |= ocf_metadata_raw_flush_do_asynch(cache, req,
&(ctrl->raw_desc[metadata_segment_collision]),
complete);
Expand Down