From 45cc56f40dcbd2ffc3be74b007b6c4a887da976a Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 2 Mar 2022 20:59:51 +0100 Subject: [PATCH] Extend BF queue protection to cache device queue So far the only resource protected by backfill queue blocking was internal OCF request queue. Move unblock to backfill io completion to protect also queue of underlying cache device. Signed-off-by: Robert Baldyga --- src/engine/engine_bf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/engine_bf.c b/src/engine/engine_bf.c index 250b809..43351c1 100644 --- a/src/engine/engine_bf.c +++ b/src/engine/engine_bf.c @@ -54,6 +54,8 @@ static void _ocf_backfill_complete(struct ocf_request *req, int error) if (env_atomic_dec_return(&req->req_remaining)) return; + backfill_queue_dec_unblock(req->cache); + /* We must free the pages we have allocated */ ctx_data_secure_erase(cache->owner, req->data); ctx_data_munlock(cache->owner, req->data); @@ -75,8 +77,6 @@ static int _ocf_backfill_do(struct ocf_request *req) { unsigned int reqs_to_issue; - backfill_queue_dec_unblock(req->cache); - reqs_to_issue = ocf_engine_io_count(req); /* There will be #reqs_to_issue completions */