From d9d8062f7c84d7c5aae97a5306434ca47618519f Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Thu, 24 Mar 2022 09:05:14 +0100 Subject: [PATCH] Mark cache priv as inited during activate Cache priv is being allocated on starting cache instance and is freed only when stopping cache. This cachnge allows to properly handle rollback if activate has failed. Without setting this flag managment queue is not being stopped despite its cache doesn't exist. Signed-off-by: Michal Mielewczyk --- modules/cas_cache/layer_cache_management.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/cas_cache/layer_cache_management.c b/modules/cas_cache/layer_cache_management.c index 18b504b..613bc8e 100644 --- a/modules/cas_cache/layer_cache_management.c +++ b/modules/cas_cache/layer_cache_management.c @@ -2352,6 +2352,9 @@ int cache_mngt_activate(struct ocf_mngt_cache_standby_activate_config *cfg, cache_priv = ocf_cache_get_priv(cache); cache_priv->attach_context = context; + /* All the required memory has been alocated and initialized on cache_init, + * just set the flag to allow deinit*/ + context->priv_inited = true; context->rollback_thread = cas_lazy_thread_create(cache_start_rollback, context, "cas_cache_rollback_complete");