Merge pull request #206 from Open-CAS/fix-leaking-core-volumes
Fix leaking front and core volumes
This commit is contained in:
commit
252cb2dd8e
@ -22,7 +22,11 @@ int cache_mngt_core_close(ocf_core_t core)
|
||||
if (!core->opened)
|
||||
return -OCF_ERR_CORE_IN_INACTIVE_STATE;
|
||||
|
||||
ocf_volume_close(&core->front_volume);
|
||||
ocf_volume_deinit(&core->front_volume);
|
||||
|
||||
ocf_volume_close(&core->volume);
|
||||
ocf_volume_deinit(&core->volume);
|
||||
core->opened = false;
|
||||
|
||||
return 0;
|
||||
|
@ -456,7 +456,11 @@ int ocf_mngt_core_init_front_volume(ocf_core_t core)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return ocf_volume_open(&core->front_volume, NULL);
|
||||
ret = ocf_volume_open(&core->front_volume, NULL);
|
||||
if (ret)
|
||||
ocf_volume_deinit(&core->front_volume);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ocf_mngt_cache_add_core_prepare(ocf_pipeline_t pipeline,
|
||||
@ -659,8 +663,6 @@ static void _ocf_mngt_cache_remove_core(ocf_pipeline_t pipeline, void *priv,
|
||||
|
||||
ocf_core_log(core, log_debug, "Removing core\n");
|
||||
|
||||
ocf_volume_close(&core->front_volume);
|
||||
|
||||
/* Deinit everything*/
|
||||
if (ocf_cache_is_device_attached(cache)) {
|
||||
cache_mngt_core_deinit_attached_meta(core);
|
||||
|
Loading…
Reference in New Issue
Block a user