cas_cache: log failed creating exported object

To avoid logging the same message each time _cache_mngt_create_exported_object()
is called, print error message within it.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2020-07-07 08:06:48 -04:00
parent 296cb0ef86
commit 017c4261b0
2 changed files with 10 additions and 8 deletions

View File

@ -1606,15 +1606,10 @@ out_get:
static int _cache_mngt_create_exported_object(ocf_core_t core, void *cntx) static int _cache_mngt_create_exported_object(ocf_core_t core, void *cntx)
{ {
int result; int result;
ocf_cache_t cache = ocf_core_get_cache(core);
result = block_dev_create_exported_object(core); result = block_dev_create_exported_object(core);
if (result) { if (result)
printk(KERN_ERR "Cannot to create exported object, %s.%s\n",
ocf_cache_get_name(cache),
ocf_core_get_name(core));
return result; return result;
}
result = block_dev_activate_exported_object(core); result = block_dev_activate_exported_object(core);

View File

@ -879,8 +879,10 @@ int block_dev_create_exported_object(ocf_core_t core)
get_core_id_string(core)); get_core_id_string(core));
dsk = casdisk_functions.casdsk_disk_claim(uuid->data, core); dsk = casdisk_functions.casdsk_disk_claim(uuid->data, core);
if (dsk != bvol->dsk) if (dsk != bvol->dsk) {
return -KCAS_ERR_SYSTEM; result = -KCAS_ERR_SYSTEM;
goto end;
}
if (cas_upgrade_is_in_upgrade()) { if (cas_upgrade_is_in_upgrade()) {
bvol->expobj_valid = true; bvol->expobj_valid = true;
@ -892,6 +894,11 @@ int block_dev_create_exported_object(ocf_core_t core)
if (!result) if (!result)
bvol->expobj_valid = true; bvol->expobj_valid = true;
end:
if (result) {
printk(KERN_ERR "Cannot create exported object %s. Error code %d\n",
dev_name, result);
}
return result; return result;
} }