Merge pull request #1141 from mmichal10/stop-standby

Allow to stop standby instance
This commit is contained in:
Robert Baldyga 2022-03-29 10:16:00 +02:00 committed by GitHub
commit 2a8e797d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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