Don't try to restore cache after stop error.
In current OCF cache stop implemetation no error should occur, so there is no need to handle it in adapter. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
232f13a8a4
commit
36e34b5a69
@ -291,7 +291,7 @@ static int exit_instance_finish(ocf_cache_t cache, int error)
|
|||||||
mngt_queue = cache_priv->mngt_queue;
|
mngt_queue = cache_priv->mngt_queue;
|
||||||
|
|
||||||
if (error && error != -OCF_ERR_WRITE_CACHE)
|
if (error && error != -OCF_ERR_WRITE_CACHE)
|
||||||
goto restore_exp_obj;
|
BUG_ON(error);
|
||||||
|
|
||||||
if (!error && flush_status)
|
if (!error && flush_status)
|
||||||
error = -KCAS_ERR_STOPPED_DIRTY;
|
error = -KCAS_ERR_STOPPED_DIRTY;
|
||||||
@ -307,25 +307,6 @@ static int exit_instance_finish(ocf_cache_t cache, int error)
|
|||||||
ocf_queue_put(mngt_queue);
|
ocf_queue_put(mngt_queue);
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
restore_exp_obj:
|
|
||||||
if (block_dev_create_all_exported_objects(cache)) {
|
|
||||||
/* Print error msg but do not change return err code to inform user why
|
|
||||||
* stop failed originally. */
|
|
||||||
printk(KERN_WARNING
|
|
||||||
"Failed to restore (create) all exported objects!\n");
|
|
||||||
goto unlock;
|
|
||||||
}
|
|
||||||
if (block_dev_activate_all_exported_objects(cache)) {
|
|
||||||
block_dev_destroy_all_exported_objects(cache);
|
|
||||||
printk(KERN_WARNING
|
|
||||||
"Failed to restore (activate) all exported objects!\n");
|
|
||||||
}
|
|
||||||
unlock:
|
|
||||||
ocf_mngt_cache_unlock(cache);
|
|
||||||
ocf_mngt_cache_put(cache);
|
|
||||||
module_put(THIS_MODULE);
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _cache_mngt_attach_context {
|
struct _cache_mngt_attach_context {
|
||||||
|
Loading…
Reference in New Issue
Block a user