Don't remove core exported objects on standby stop

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2022-03-29 08:22:01 +02:00
parent eae8bf92e5
commit fb97333688

View File

@ -2893,19 +2893,21 @@ int cache_mngt_exit_instance(const char *cache_name, size_t name_len, int flush)
goto unlock; goto unlock;
} }
/* Destroy cache devices */ if (!ocf_cache_is_standby(cache)) {
status = kcas_cache_destroy_all_core_exported_objects(cache); status = kcas_cache_destroy_all_core_exported_objects(cache);
if (status != 0) { if (status != 0) {
printk(KERN_WARNING printk(KERN_WARNING
"Failed to remove all cached devices\n"); "Failed to remove all cached devices\n");
goto stop_thread; goto stop_thread;
} }
} else {
status = kcas_cache_destroy_exported_object(cache); status = kcas_cache_destroy_exported_object(cache);
if (status != 0) { if (status != 0) {
printk(KERN_WARNING printk(KERN_WARNING
"Failed to remove cache exported object\n"); "Failed to remove cache exported object\n");
goto stop_thread; goto stop_thread;
} }
}
/* Flush cache again. This time we don't allow interruption. */ /* Flush cache again. This time we don't allow interruption. */
if (flush && ocf_cache_is_running(cache)) if (flush && ocf_cache_is_running(cache))