Merge pull request #86 from Donaim/delay-put-cache

Put cache after doing pipeline_destroy
This commit is contained in:
Michał Wysoczański 2019-03-26 11:38:01 +01:00 committed by GitHub
commit 08a5b9d2a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2068,11 +2068,8 @@ static void ocf_mngt_cache_stop_finish(ocf_pipeline_t pipeline,
cache->valid_ocf_cache_device_t = 0;
/* Remove cache from the list */
list_del(&cache->list);
/* Finally release cache instance */
ocf_mngt_cache_put(cache);
env_mutex_unlock(&ctx->lock);
if (context->error == -OCF_ERR_WRITE_CACHE) {
ocf_log(ctx, log_warn, "Stopped cache %s with errors\n",
context->cache_name);
@ -2087,6 +2084,9 @@ static void ocf_mngt_cache_stop_finish(ocf_pipeline_t pipeline,
context->cmpl(cache, context->priv, context->error);
ocf_pipeline_destroy(context->pipeline);
/* Finally release cache instance */
ocf_mngt_cache_put(cache);
}
struct ocf_pipeline_properties ocf_mngt_cache_stop_pipeline_properties = {