cas_cache: log failed activating exported object
To avoid logging the same message each time block_dev_activate_exported_object() is called, print error message within it. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
8363b67993
commit
296cb0ef86
@ -1617,11 +1617,6 @@ static int _cache_mngt_create_exported_object(ocf_core_t core, void *cntx)
|
||||
}
|
||||
|
||||
result = block_dev_activate_exported_object(core);
|
||||
if (result) {
|
||||
printk(KERN_ERR "Cannot to activate exported object, %s.%s\n",
|
||||
ocf_cache_get_name(cache),
|
||||
ocf_core_get_name(core));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -822,16 +822,24 @@ int block_dev_activate_exported_object(ocf_core_t core)
|
||||
{
|
||||
int ret;
|
||||
ocf_volume_t obj = ocf_core_get_volume(core);
|
||||
ocf_cache_t cache = ocf_core_get_cache(core);
|
||||
struct bd_object *bvol = bd_object(obj);
|
||||
|
||||
if (!cas_upgrade_is_in_upgrade()) {
|
||||
ret = casdisk_functions.casdsk_exp_obj_activate(bvol->dsk);
|
||||
if (-EEXIST == ret)
|
||||
return KCAS_ERR_FILE_EXISTS;
|
||||
ret = KCAS_ERR_FILE_EXISTS;
|
||||
} else {
|
||||
ret = casdisk_functions.casdsk_disk_attach(bvol->dsk, THIS_MODULE,
|
||||
&_blockdev_exp_obj_ops);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
printk(KERN_ERR "Cannot activate exported object, %s.%s. "
|
||||
"Error code %d\n", ocf_cache_get_name(cache),
|
||||
ocf_core_get_name(core), ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user