From 51b0b195e8ebd4d3abd063a2b835a412736087d3 Mon Sep 17 00:00:00 2001 From: Daniel Madej Date: Wed, 15 Jan 2025 18:48:21 +0100 Subject: [PATCH] ocf_cleaner_refcnt_unfreeze bug fix During core remove/detach ocf_cleaner_refcnt_freeze was called only when cache was attached, but ocf_cleaner_refcnt_unfreeze was called regardless of cache state. Signed-off-by: Daniel Madej --- src/mngt/ocf_mngt_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mngt/ocf_mngt_core.c b/src/mngt/ocf_mngt_core.c index ea2f4799..38f121e6 100644 --- a/src/mngt/ocf_mngt_core.c +++ b/src/mngt/ocf_mngt_core.c @@ -643,7 +643,9 @@ static void ocf_mngt_cache_remove_core_finish(ocf_pipeline_t pipeline, context->core_name); } - ocf_cleaner_refcnt_unfreeze(cache); + if (ocf_cache_is_device_attached(cache)) { + ocf_cleaner_refcnt_unfreeze(cache); + } context->cmpl(context->priv, error); @@ -826,7 +828,9 @@ static void ocf_mngt_cache_detach_core_finish(ocf_pipeline_t pipeline, context->core_name); } - ocf_cleaner_refcnt_unfreeze(context->cache); + if (ocf_cache_is_device_attached(cache)) { + ocf_cleaner_refcnt_unfreeze(cache); + } context->cmpl(context->priv, error);