Fix exported object cleanup in case of cache stop failure
In case of error during cache stop exported object is not being restored after destroying. This may result in bug in case of calling stop once more. This commit fixes this issue - exported objects are restored. Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
@@ -894,6 +894,7 @@ int block_dev_activate_all_exported_objects(ocf_cache_t cache)
|
||||
return ocf_core_visit(cache, _block_dev_activate_exported_object, NULL,
|
||||
true);
|
||||
}
|
||||
|
||||
int block_dev_create_exported_object(ocf_core_t core)
|
||||
{
|
||||
ocf_volume_t obj = ocf_core_get_volume(core);
|
||||
@@ -925,7 +926,8 @@ int block_dev_create_exported_object(ocf_core_t core)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int _block_dev_create_exported_object_visitor(ocf_core_t core, void *cntx){
|
||||
static int _block_dev_create_exported_object_visitor(ocf_core_t core, void *cntx)
|
||||
{
|
||||
return block_dev_create_exported_object(core);
|
||||
}
|
||||
|
||||
@@ -934,6 +936,7 @@ int block_dev_create_all_exported_objects(ocf_cache_t cache)
|
||||
return ocf_core_visit(cache, _block_dev_create_exported_object_visitor, NULL,
|
||||
true);
|
||||
}
|
||||
|
||||
int block_dev_destroy_exported_object(ocf_core_t core)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -1033,8 +1036,10 @@ int block_dev_destroy_all_exported_objects(ocf_cache_t cache)
|
||||
|
||||
ocf_core_visit(cache, _block_dev_stop_exported_object, NULL, true);
|
||||
|
||||
block_dev_free_all_exported_objects(cache);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _block_dev_free_exported_object(ocf_core_t core, void *cntx)
|
||||
{
|
||||
struct bd_object *bvol = bd_object(
|
||||
|
Reference in New Issue
Block a user