Return error on invalid core id

Instead of silently allowing for any core_id in order to set
core parameter for all cores in cache, check explicitly for
special value (OCF_CORE_ID_INVALID) which means that no core
has been selected.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2019-09-25 17:22:01 +02:00
parent b470052bf1
commit a7390aa6fc

View File

@ -2021,9 +2021,11 @@ int cache_mngt_set_core_params(struct kcas_set_core_param *info)
if (result)
return result;
result = get_core_by_id(cache, info->core_id, &core);
if (result && result != -OCF_ERR_CORE_NOT_EXIST)
goto out;
if (info->core_id != OCF_CORE_ID_INVALID) {
result = get_core_by_id(cache, info->core_id, &core);
if (result)
goto out;
}
switch (info->param_id) {
case core_param_seq_cutoff_threshold: