fix for issue #1023
Better error for core size mismatch during activation/load adding pyocf test for new error code Signed-off-by: Piotr Debski <piotr.debski@intel.com>
This commit is contained in:
@@ -382,6 +382,7 @@ static void _ocf_mngt_load_add_cores(ocf_pipeline_t pipeline,
|
||||
int ret = -1;
|
||||
uint64_t hd_lines = 0;
|
||||
uint64_t length;
|
||||
ocf_error_t error = -OCF_ERR_START_CACHE_FAIL;
|
||||
|
||||
OCF_ASSERT_PLUGGED(cache);
|
||||
|
||||
@@ -464,10 +465,11 @@ static void _ocf_mngt_load_add_cores(ocf_pipeline_t pipeline,
|
||||
|
||||
length = ocf_volume_get_length(&core->volume);
|
||||
if (length != core->conf_meta->length) {
|
||||
ocf_cache_log(cache, log_err,
|
||||
ocf_core_log(core, log_err,
|
||||
"Size of core volume doesn't match with"
|
||||
" the size stored in cache metadata!");
|
||||
goto err;
|
||||
error = -OCF_ERR_CORE_SIZE_MISMATCH;
|
||||
goto err;
|
||||
}
|
||||
|
||||
hd_lines = ocf_bytes_2_lines(cache, length);
|
||||
@@ -484,7 +486,7 @@ static void _ocf_mngt_load_add_cores(ocf_pipeline_t pipeline,
|
||||
err:
|
||||
_ocf_mngt_close_all_uninitialized_cores(context);
|
||||
|
||||
OCF_PL_FINISH_RET(pipeline, -OCF_ERR_START_CACHE_FAIL);
|
||||
OCF_PL_FINISH_RET(pipeline, error);
|
||||
}
|
||||
|
||||
static void _recovery_reset_cline_metadata(struct ocf_cache *cache,
|
||||
|
@@ -305,7 +305,7 @@ static void ocf_mngt_cache_try_add_core_insert(ocf_pipeline_t pipeline,
|
||||
ocf_cache_log(cache, log_err,
|
||||
"Size of core volume doesn't match with"
|
||||
" the size stored in cache metadata!\n");
|
||||
result = -OCF_ERR_CORE_NOT_AVAIL;
|
||||
result = -OCF_ERR_CORE_SIZE_MISMATCH;
|
||||
goto error_after_open;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user