commit
3c2fd8059c
@ -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");
|
||||
@ -2369,12 +2372,13 @@ int cache_mngt_activate(struct ocf_mngt_cache_standby_activate_config *cfg,
|
||||
if (result == -KCAS_ERR_WAITING_INTERRUPTED)
|
||||
goto out_cache_put;
|
||||
if (result)
|
||||
goto err;
|
||||
goto activate_err;
|
||||
|
||||
result = _cache_start_finalize(cache, -1, true);
|
||||
if (result)
|
||||
goto err;
|
||||
goto finalize_err;
|
||||
|
||||
activate_err:
|
||||
cas_lazy_thread_stop(context->rollback_thread);
|
||||
|
||||
err_free_context:
|
||||
@ -2389,7 +2393,7 @@ out_module_put:
|
||||
module_put(THIS_MODULE);
|
||||
return result;
|
||||
|
||||
err:
|
||||
finalize_err:
|
||||
_cache_mngt_async_context_reinit(&context->async);
|
||||
ocf_mngt_cache_stop(cache, _cache_mngt_cache_stop_rollback_complete,
|
||||
context);
|
||||
@ -2401,6 +2405,7 @@ err:
|
||||
if (rollback_result != -KCAS_ERR_WAITING_INTERRUPTED)
|
||||
kfree(context);
|
||||
|
||||
module_put(THIS_MODULE);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user